Collection API endpoint not working?

Bismuth_doug
Tourist
8 0 7

Hi!

 

Working on making a simple api call to retrieve all collections.

 

When I hit the following endpoint:

 

https://<key>:<secret>@<shop>.myshopify.com/admin/api/2019-10/collections.json

 

My code throws a 404.  But when I hit the same URL with a "products", "shop", "orders" or seemingly any other endpoint, i get a 200 and my data comes through fine.

 

Even more strangely, if i go to the above address in my browser, I get a nice clean json object with all of my desired data.  Can anybody tell me why this endpoint doesnt work?

0 Likes
Visely-Team
Shopify Partner
1837 210 421

You get a clean JSON in the browser because you are logged in. Is the key/secret for a private app or a public app? 

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
0 Likes
Yurіі
Shopify Partner
63 13 18

Try to call CustomCollections and SmartCollections instead:

 

curl -X GET https://<key>:<secret>@<shop>.myshopify.com/admin/api/2019-10/custom_collections.json -H 'Content-Type: application/json'
curl -X GET https://<key>:<secret>@<shop>.myshopify.com/admin/api/2019-10/smart_collections.json -H 'Content-Type: application/json'



Thanks for reading, don’t forget to like and subscribe!
Wrong outro - Click Like and Accept as Solution if it was helpful and help other to find the answer ?
0 Likes