401 Unauthorized while requesting Order JSON

401 Unauthorized while requesting Order JSON

zzcain
Shopify Partner
3 0 0

URI: "https://storenamehere.myshopify.com/admin/orders.json?since_id=5764593647719&status=any&limit=250"

Header: "Authorization", "Basic hashedkeyhere"

Hashed Key is Generated using this: 

"Basic " + Base64Encode(this.apiKey + ":" + this.secretKey);

Response:

System.Net.WebException
  HResult=0x80131509
  Message=The remote server returned an error: (401) Unauthorized.
  Source=System

I have verified that the key & secret are accurate... at least, I think I have... What else can I check?

 

Replies 3 (3)

Liam
Shopify Staff
2873 312 818

Hi - the url you're using doesn't have an API version specified, could you try with an API version? eg: `/admin/api/2024-01/orders.json`

Liam | Developer Advocate @ 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

zzcain
Shopify Partner
3 0 0

Thanks for the suggestion, but unfortunately I get the same response.

What can I do to confirm that the API Key & Secret are correct? That is all I can think of to check.

zzcain
Shopify Partner
3 0 0

Actually, I have confirmed the API Key & Secret as well as making sure the "Admin API access scopes" has "read_orders"... What else?