This call to Prestashop Web Services failed and returned an HTTP status of 401. That means: Unauthorized

This call to Prestashop Web Services failed and returned an HTTP status of 401. That means: Unauthorized

Overview 


You encountered a problem when using the wizard to integrate your prestashop and you get the answer shown in the screenshot below. This article explains what the problem is and how to fix it because it is possible that the issue comes from different reasons.




Option 1 : Prestashop services aren't enabled

Sometimes those settings aren't set to properly so prestashop won't authorize a 3rd party to connect to their servers.
Go to your prestashop into "advanced settings" -> "webservice" and make sure both options are set on "Yes".
The CGI option isn't mandatory if your server isn't compatible.



Option 2 : API key's permissions aren't set

After creating a new API key in prestashop, you need to make sure it has all the permissions so that BoostMyShop can access everything.
In order to do that, go to "advanced settings" -> "webservice" and select the API key you used in BoostMyShop. Then tick all the boxes in the permissions and press save.




Option 3 : HTaccess authorization


This configuration rewrites all requests to your front controller and adds the HTTP_AUTHORIZATION header.

There are multiple ways to get Apache to pass this header:

1/ If you have SetEnv module enabled you can use this one
# Requires Module
# SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

2/ Or you can configure via RewriteRules in the Directory or VirtualHost.

# RewriteCond %{HTTP:Authorization} ^(.*)
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%1]

3/ If you have another Front controller, you can configure rewrite like this
RewriteRule .* /index.php [L,QSA]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:AUTHORIZATION}]

    • Related Articles

    • Prestashop integration error : HTTP-Error 500 (internal server error)

      Overview  You encountered a problem when using the wizard to integrate your prestashop . This article explains what the problem is and how to fix it. How to fix This error comes from a compatibility issue between the PHP version on your server and ...
    • Magento1 integration: SOAP-ERROR: Parsing WSDL: Couldn't load from / failed to load external entity

      Overview This article explains why error "SOAP-ERROR: Parsing WSDL: Couldn't load from / failed to load external entity" happens and how to fix it This error can happen when you configure a Magento1 integration and save it, the full error message is ...
    • Magento2 Unauthorized 401

      This article explains why you may experience a 401 unauthorized error in Boostmyshop and how to fix it A 401 error means that Boostmyshop  can not communicate with your magento2 website, this may happen if :  The login or password configured in the ...
    • Prestashop - Unable to export stock : No stock available found for shop

      This article explains the "No stock available found for shop" error in the stock export feed for Prestashop integration Explanations When myFulfillment sends a stock update to Prestashop, among the product, combination and quantity, myFulfillment may ...
    • Authentication Failed during Purchase order notification

      When you hit the "Notify" button from a purchase order, if you get error message "Authentication failed", it means that you need to setup your Smtp account. To configure your SMTP account, select menu Wizards, and click on wizard "Smtp Account" :  ...