Error accessing Admin API

Highlighted
New Member
1 0 0

Hi 

 

Im trying to access the shopify Admin API

 

https://<apikey>:<apisecretkey>@boatlifestylein.myshopify.com/admin/api/2020-04/orders.json

https://<apikey>:<apisecretkey>@boatlifestylein.myshopify.com/admin/api/2020-04/orders/123456.json

 

 

The authentication is been done using the API key and API secret key.

This does not seem to be working.

On calling this API via Postman, it gives the error

{
"errors": "[API] Invalid API key or access token (unrecognized login or wrong password)"
}

 

Since this is a GET URL, if I call this on the browser, its pops up an AUTH dialog box.

 

Does this API call require any other inputs?

 

The API document used for  reference https://shopify.dev/docs/admin-api/rest/reference/orders/order

 

 

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 102 115

Hey @vkapadia ,

 

Assuming that you are using a Private App's credentials here, you can follow this guide here: https://shopify.dev/tutorials/authenticate-a-private-app-with-shopify-admin#generate-credentials-fro...

 

The method you are using (with '<apikey>:<apisecretkey>@boatlifestylein.myshopify.com') is called Basic Auth and it should work for Postman if all you are looking to do is use GET requests. However as per the docs, and alternative method that tends to work better (and works for POST requests) is this:

Shopify access token

Private apps can authenticate with Shopify by including the request header X-Shopify-Access-Token: {access_token}, where {access_token} is replaced by your private app's Admin API password.

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes