I am using PrestaShopWebservice library to access Prestashiop 1.7 Webservice, I always get 401 Unauthorized
but it is accessible in browser.
I have already tried adding:
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
in .htaccess
also tried concatenating &ws_key="token"
but nothing works
$url = 'http://someurl/api/';
$token = 'mytoken';
try {
$webService = new \PrestaShopWebservice($url, $token, true);
$xml = $webService->get(['resource'=>'products']);
var_dump($xml);
}
catch (\PrestaShopWebserviceException $ex) {
echo 'Other error: <br />' . $ex->getMessage();
}