Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Can't Connect to Shopify Admin API

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 6 (6)

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
1453 238 524

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
1453 238 524

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

Kavithan
Visitor
1 0 0

Im having the same exact problem