Focuses on API authentication, access scopes, and permission management.
I am trying to authenticate my Access Token with curl to use an admin API, but then I run
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?
Hi,
Are you sure you are using the Admin API password and not the Storefront API password?
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
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
Im having the same exact problem