GET requests to REST API don't work with Curl or Postman, just Chrome?

Highlighted
Excursionist
17 0 4

I am very sure this is a very silly mistake on my part. I have a working app that has no problem making requests to both the GraphQL and REST APIs, and am adding some calls to the Orders API. I wanted to prototype them in Postman, but have not been able to get any request to work, every request is met with a 

"errors": "[API] Invalid API key or access token (unrecognized login or wrong password)" response.
 
 Following the instructions at https://shopify.dev/tutorials/debug-apps-with-postman-for-mac-os I am using the standard URL format: 
 
https://<API Key>:<password>@<store name>.myshopify.com/admin/api/2020-07/shop.json
 
All my requests are GET requests (shop.json, orders.json, etc) so cookies shouldn't be an issue though I've cleared them in Postman. I've also tried the basic auth approach.
 
These URLs don't work with Curl either, but the weird part is if I try the URLs in Chrome, they work perfectly and return JSON with all the orders and customer information that shop.json and orders.json are supposed to return.
 
I'm thinking my mistake is using the wrong password. I'm using my login password and that doesn't seem right, but its the only password I can find in my account (I'm owner/admin) and it works for the URLs when I use Chrome?
 
 
 
 
1 Like
Highlighted
Tourist
7 1 1

I'm having this same exact issue when following the guide online with a cURL command.  Have you found a solution to it?  

Thanks.

1 Like
Highlighted
Excursionist
17 0 4

@akatcha I'm back on this, and in Shopify just got a GET request to /admin/api/2020-07/orders/count.json working using a "X-Shopify-Access-Token" with no authorization.

1 Like
Highlighted
Excursionist
17 0 4

Of course it doesn't work from my app, but one problem at a time.

0 Likes
Highlighted
Excursionist
38 1 8

Hi

This one is working for me for my app

const productImageAdminAPI = `https://${auth.shop}/admin/api/${process.env.API_VERSION}/products/${productId}/images.json`;

return fetch(productImageAdminAPI, {
method: 'post',
body: JSON.stringify(body),
headers: {
'Content-Type': 'application/json',
'X-Shopify-Access-Token': auth.accessToken,
},
}).then((res) => res.json());

For Postman I do it like: 

image.png

https://API_KEY:PASS@ ... .myshopify.com/admin/api/2020-04/products/${productId}/images.json works for private apps. 

https://apps.shopify.com/picamaze
Animated watermarks for product images and ads
2 Likes