Can't Connect to Shopify Admin API

ewebton
Visitor
3 0 0

I am trying to authenticate my Access Token with curl to use an admin API, but then I ru

 

curl -X GET https://{shop}.myshopify.com/admin/api/2022-10/products.json -H 'Content-Type:application/json' -H 'X-Shopify-Access-Token:{access-token}'

 

I get the error message: 

 

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

 

I am certain my shop username and API key is correct, and I copied this curl command straight from the shopify documentation. Do I have to be an admin to the shop itself in order to use this? 

Replies 5 (5)

Antoine054
Shopify Partner
12 2 1

Hi,

Are you sure you are using the Admin API password and not the Storefront API password?

ewebton
Visitor
3 0 0
Hi,

I am not the owner of this shopify store, does that change anything?
ShopifyDevSup
Shopify Staff
1249 201 442

Hi @ewebton  👋


To make authenticated requests to the Admin API, you'll need to use the Admin access token rather than the API key. I'd recommend reviewing this page on different types of authentication/authorization methods depending on your app type. If you're working with a custom app created in the Admin, you can use this guide to get and use access tokens.

 

Hope that helps!

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

ewebton
Visitor
3 0 0
Hi,

Yes, I used the access key, not the API. I apologize, I should have been
more specific in my question.
ShopifyDevSup
Shopify Staff
1249 201 442

In that case, it may be best to contact us here with your authenticated account with access to this app and merchant store. Please be sure to provide the team with the X-Request-ID (and timestamp) found in the response headers, the app ID, and the shop name/ID. This way we should be able to investigate whether your access token is valid. 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog