Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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
Community Manager
3108 344 910

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?