0
votes

I'm creating a simple shopify app. I'm not using the official libraries and SDK and there's a reason to my madness. I'm using curl.

Say, a user

a) has installed my app and then

b) I've also obtained "access_token" by sending a request to "https://{shop}/admin/oauth/access_token"

Now. I want to send a request to retrieve the user's list of products. The url for that is "GET https://{shop}.myshopify.com/admin/products.json"

I've read the documentation but there's ambiguity as in some places it says to use login-pass and in other the api-key.

In other words, how exactly should I send such a request? What headers exactly should I include ? What to do with the access_token?

1

1 Answers

0
votes

There is no ambiguity. If you have an oAuth access token, structure your call to the RESTful API as per the instructions. Include your token in the header and make your call:

header X-Shopify-Access-Token: {access_token}

If instead you use Shopify to create a private App you're issued an API key and password, in which case your calls are structured like this:

https://apikey:password@hostname/admin/resource.json