Re: Invalid API key or access token while using access_token given by oauth/callback for my App

Invalid API key or access token while using access_token given by oauth/callback for my App

shubhamf22labs
Shopify Partner
2 0 0

When using below API

 

 

 

curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-07/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query { orders(first: 10) { edges { node { id } } } }"
}'

 

 

 


With the access_token given by oauth/callback by following 

 

 

 

 const permissionUrl = `https://${shopOrigin}/admin/oauth/authorize?client_id=${apiKey}&scope=${[
      "read_orders",
      "read_all_orders",
    ].join(",")}&redirect_uri=${redirectUri}`;

 

 

 

 Still while trying to fetch anything it ask for username and password.

The following error comes: 

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


Everything was working fine, nothing changed.

Replies 3 (3)

YOD_Solutions
Shopify Partner
284 29 43

You might need to request the "protected customer data access" in your app dashboard, under "API Access" section.

Founder @ JsRates: Custom Shipping Rates
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more about JsRates visit the JsRates home page or JsRates documentation
- Find JsRates on Shopify app store
shubhamf22labs
Shopify Partner
2 0 0

I have that too
 Screenshot 2024-10-15 at 10.05.19 AM.png

gojiberry-des
Shopify Partner
29 7 5

Just a very basic check, but did you replace "your-development-store.myshopify.com" in your example curl command with your own store's URL?

If you like my suggestion please give it a LIKE or mark it as a solution! ★★★★★

Gojiberry - Best post-purchase survey and feedback app for Shopify | Install on App Store for free
Shopify Community is helpful, BUT... why not start asking your customers for feedback instead?