Admin API working in Postman but not in Code

bansalnagesh
New Member
1 0 0

I am trying to work on a Public App. It is unlisted right now. My code is in Ruby. I have got the Access token and stored it in my database.

Now I am trying to fetch the products for the user. When doing the same, I am getting a [API] Invalid API key or access token (unrecognized login or wrong password) error.

I tried to hit the same API using Postman and I am getting a response:

bansalnagesh_0-1595748647064.png

But when trying to do the same using code, I am getting 401 error. I have tried using both shopify_api gem and direct Curl requests in code.

Here is one of the  "x-request-id"=>["67205c9d-4ee1-454f-bc75-1ff313754c4f"] from code that is throwing error. 

Also I have verified that the access scope is not per_user but offline access mode. 

I see that this is a fairly common issue but there are no satisfactory answers out there. Can someone help me. 

0 Likes
Kevin_A
Shopify Staff
Shopify Staff
213 27 39

Hey @bansalnagesh 

Would you be able to share some of your source code so we can take a look? Feel free to DM me if you don't want this information made public.

Kevin_A | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me 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

0 Likes