Jump to content

API Error - 401 Unauthorized


Eren

Recommended Posts

Hello,

I want to use invoice portal. Portal api request is send to the this link. https://mydomainexample.com/api/order_states?display=full&output_format=JSON asked a me username password. I write api key and other username pass but not working. I add to &ws_key=WEBSERVICE_KEY working. but invoice portal don't want this link. Please help me.

Link to comment
Share on other sites

Hi,

Ensure that the API key you are using has the necessary permissions to access order_states. You can check and set these permissions in the PrestaShop BackOffice under Advanced Parameters > Webservices

Usually, for basic authentication, you provide a username and password in the request header. Ensure you are encoding them properly.
If you need to include the API key directly in the URL, it should be done as &ws_key=WEBSERVICE_KEY, which seems to work based on your message
Use tools like Postman or cURL to test the API endpoint with both basic authentication and the API key method to ensure the endpoint itself is functioning correctly.
curl -u 'username:password' 'https://mydomainexample.com/api/order_states?display=full&output_format=JSON'

Link to comment
Share on other sites

1 minute ago, Knowband Plugins said:

Hi,

Ensure that the API key you are using has the necessary permissions to access order_states. You can check and set these permissions in the PrestaShop BackOffice under Advanced Parameters > Webservices

Usually, for basic authentication, you provide a username and password in the request header. Ensure you are encoding them properly.
If you need to include the API key directly in the URL, it should be done as &ws_key=WEBSERVICE_KEY, which seems to work based on your message
Use tools like Postman or cURL to test the API endpoint with both basic authentication and the API key method to ensure the endpoint itself is functioning correctly.
curl -u 'username:password' 'https://mydomainexample.com/api/order_states?display=full&output_format=JSON'

The API does not belong to me. I only know the url they sent the request to. Do they now need to send the request as &ws_key=web_service_key?

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