Invalid API key or access token

Solved
gkrone
Excursionist
12 2 0

I'm using Postman to test needed updates to API version 2019-07.  

 

I have a request for orders.json using API version 2019-07 that is returning orders as expected.

 

The call to get a list of products.json and it gives me "401 Unauthorized" status and the error

{

"errors": "[API] Invalid API key or access token (unrecognized login or wrong password)"
}
 
I have the same authorization on both calls.
 
If I change the orders.json Postman call to the products.json call I get the same error.
 
The last X-Request-ID is 447925f5-7d2d-4045-995e-182ceaf14c93
 
Any ideas on what to look for?
 
Thanks
0 Likes
Jivan_Suhagiya
Shopify Partner
494 68 102
Edit:
Hi,
There is possibility of only access for read_orders, please double check for read_products also
If helpful then please Like and Accept Solution.
Email: suhagiyajivan1992@gmail.com
Skype: jivan.suhagiya
First kind of Checkout Reminder APP: https://apps.shopify.com/checkout-reminder
gkrone
Excursionist
12 2 0

Why would a write order block effect a request for the product list?

0 Likes
gkrone
Excursionist
12 2 0

This is an accepted solution.

You were correct about the access to read_products.  I dug into our integration and found that the client I was using to test was not set up for us to synch products.  When I changed to a client that we were synching products I got the list.

 

Now I pull the "Link" from the header to get the next set of products and send it through postman and I get:

 

{
"errors": {
"page_info": "Invalid value."
}
}
 
Is there a time span where the page_info is valid?

 

 

0 Likes
JoyfulFlappers
New Member
1 0 0

Can anyone tell me why I keep getting this same error message when I try and sync our products for the first time in Word Press?

 

Thank you!

0 Likes
gkrone
Excursionist
12 2 0

I found that using the HttpClient (C#) was causing the problem.  When I switched to using RestSharp I was able to retrieve all pages using the links. RestSharp must be doing something in the background that I was not able to track down when configuring the HttpClient.

0 Likes
DavidBogdan
New Member
2 0 0

It works with HttpClient but it's a bit "special", so in case someone needs this in the future, here is the solution https://shopify.dev/tutorials/authenticate-a-private-app-with-shopify-admin#:~:text=Basic%20authenti...

  1. Join the API key and password with a single colon (:).

  2. Encode the resulting string in base64 representation.

  3. Prepend the base64-encoded string with Basic and a space and add this as header: Authorization: Basic NDQ3OGViN2FjMTM4YTEzNjg1MmJhYmQ4NjE5NTZjMTk6M2U1YTZlZGVjNzFlYWIwMzk0MjJjNjQ0NGQwMjY1OWQ=

0 Likes