Jump to content

API Invalid authentication key format


Zaarrr

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.

Mizar.

prestashop_2.png

prestashop_1.png

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/

image.png.b90e7aaaa337b610e0f00fe2a9f29955.png

Next 

in the Authorization tab

Type: Basic Auth

Username: YOUR_API_KEY

Password : [empty]

image.png.66f69daf461ef1854c50b02b9081cf51.png

Next

in the Headers tab

Output-Format: JSON

image.png.06d1898acf843bf755a200c6b0d0cab3.png

Next Click SEND button 

image.png.886a46a58db7b751a983503918e81751.png

 

  • 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...