Making REST API calls to shopify store
Sometimes you may want to make REST API Calls to your Shopify Store. For example you may want to check the installed theme of your store and check if it supports app blocks.
The easiest way to do this is by going to your store and make the REST call right in your browser. Let’s take the theme example. If you navigate to
{your-store}.myshopify.com/admin/themes
You will be presented an overview of all your themes on your User interface. However if you add .json to that URL you will get the according JSON response:
{your-store}.myshopify.com/admin/themes.json
This request works because you are authenticated with your store. But how do you request this data if you are not authenticated? For example if you want to send a request with Postman?
The answer is: you will have to create a private app, get the credentials from that app and then you can make authenticated requests. And this is how it’s done:
- Go to your stores admin dashboard.
- go to Apps
- Scroll all the way to the bottom. There you should see the possibility to “Manage private apps“
- You can now click create a new private app. Make sure to create an app with all the access scopes that you need.
- After creating the new private app you can go back to the overview page of your private app. On there you will see your newly created private app.
- In order to get the apps API key and Password, click on the app’s name. You will be redirected to the app’s detail page
- You can now prepare the URL for your request. The request URL will have to look as follows
https://{PrivateAppApiKey}:{PrivateAppPassword}@{shop-url}.myshopify.com/admin/themes.json
That’s it! Now you can make authenticated API calls to your store via Postman!
If you don't feel like reading, check out my video:
Leave a Reply
Want to join the discussion?Feel free to contribute!