Jump to content

API Invalid authentication key format


Recommended Posts

Hi everyone. I hope you all are having a good day. At the moment I've started using the Prestashop API. I've tryed to access in the way is shown in the documentation. But a problem appears. When making any request I got a message saying (photo 1)

    "errors": [
            "code": 18,
            "message": "Invalid authentication key format"

Idk why this is happening. I'm putting correctly the data.

The API key and his authorization mode is putted exactly as shown in documentation. (photo 2)

I tryed too making request with another url structure that I find on an old prestashop forum post.

The structure of url was this    www.domainname.com/api/?ws_key=your key

This url correctly works but dont let me put another options ( like display : full ) and  more...

Does anyone knows if I'm putting fields in some wrong way or something like that?

I hope I was explicit.

Thanks for your time, I really Appreciate.




Link to comment
Share on other sites

Hi Mizar,

try disabling the debug mode as this notice is breaking the page if debug mode is enabled.

if there are still issues, check the log in /var/logs folder.

Also maybe(not sure) this one could help you https://stackoverflow.com/questions/17488656/zend-server-windows-authorization-header-is-not-passed-to-php-script/17489025#17489025

Kind regards, Leo

Edited by Prestachamps (see edit history)
Link to comment
Share on other sites

  • 9 months later...

You have to encode key generated in 'Advanced' > 'Api'. For example by page https://www.base64encode.org/ past there your api key and copy generated string to postment. For example:

in presta shop key : 4TQM7V66B98SBQ61B22HR2W6MKLDAYER

generated in base64.org looks like this now: NFRRTTdWNjZCOThTQlE2MUIyMkhSMlc2TUtMREFZRVI=

past it to postman Basic NFRRTTdWNjZCOThTQlE2MUIyMkhSMlc2TUtMREFZRVI=

and then send request

Edited by damian_pm (see edit history)
Link to comment
Share on other sites

  • 7 months later...

I give you a solution 

Method: GET

URL: https://your_domain.com/api/



in the Authorization tab

Type: Basic Auth

Username: YOUR_API_KEY

Password : [empty]



in the Headers tab

Output-Format: JSON


Next Click SEND button 



  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...