Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

401/403 Error on access_scopes.json request - Invalid API key or access token

dshine
Visitor
3 0 0

I have a custom app that I wrote for our existing stores. We are developing a new store and the custom app can't connect to the store. I have checked the api key, secret and token to ensure they are correct. Using postman I get a 401 error if I just use key + secret. If I add the token to the header I get a 403 error. 

 

 

Replies 3 (3)

csam
Shopify Staff (Retired)
267 40 51

Hi @dshine 

 

Have you checked the access scopes available to the app? What endpoint are you calling? 

 

 

To learn more visit the Shopify Help Center or the Community Blog.

dshine
Visitor
3 0 0

The documentation that you have for shopify_python_api borders on non-existent and what is there is actually inaccurate. After digging through the source code on github I managed to piece together a solution. 

 

I had to use shopify.ShopifyResource.set_headers to add the X-Shopify-Access-Token before I could use shopify.ShopifyResource.set_site(shop_url) to connect to the store. You would think, given that this is a vital step in the process, that would be mentioned somewhere

csam
Shopify Staff (Retired)
267 40 51

Hi @dshine 

 

Thanks for letting us know! I'll pass this along for review to be added to the documentation.

To learn more visit the Shopify Help Center or the Community Blog.