Shopify API - How to retrieve a list of events using Postman

Shopify API – How to retrieve a list of events using Postman

Do you know what an event in Shopify API is?

It’s so difficult to understand, right? Let’s start from the very beginning. 

Events are generated by some Shopify resources when certain actions are completed, such as the creation of a blog, the fulfillment of an order, or the addition of a product. By requesting events, your app can know when certain actions have occurred in the shop.

The list below are events generated by the following resources:

  • Articles
  • Blogs
  • Custom collections
  • Comments
  • Orders
  • Pages
  • Price rules
  • Products

With a new update, an event has 2 parts:

  • Verb: The nature of the occurrence. Various resources produce various types of occurrences. A list of suitable verbs can be found in the resources section.
  • Message: A human-readable description of the event. Can contain some HTML formatting.

Example: In a product, there are 4 events:

VerbMessage
createNew product created: product_title
destroyproduct_name was destroyed.
publishedproduct_title was published.
unpublishedproduct_title was hidden.

Now, do you understand? Do you wonder why we need to retrieve a list of events?

Events are default, but sometimes you will forget what events are currently available in your Shopify store. Because of this reason, Beehexa will show you how to retrieve a list of events using Postman. 

Now, let’s dive into this subject a little deeper. 

If this is the first time you make a call in the Postman, you must generate API credentials from the Shopify admin

Step 1: Generate API credentials from Shopify Admin

Follow the process in How to build a custom app for Shopify in 2022? to know how to access Shopify API. 

  • After creating an app, remember the Admin API access token and the API key to send requests in the Postman. 

Step 2: Retrieve a list of events using Postman

Now, we will retrieve a list of events using Postman with Shopify API. 

  • Log in to your Postman and create a new workspace
  • Create a new GET with this URL:
https://{API_key}:{admin_API_access_token}@{shop}.myshopify.com/admin/api/{api-version}/{resource}.json
Code language: JavaScript (javascript)
  1. {API_key} – The API key that you generated.
  2. {admin_API_access_token} – The admin API access token that you generated.
  3. {shop} – The name of your development store.
  4. {api-version} – The supported API version that you want to use.
  5. {resource} – A resource endpoint from the REST Admin API.

Or you can copy this example, remember change {resource} to {events}:

https://ed86d512a2c95387ffa25f67074a222b:[email protected]/admin/api/2022-01/events.json
Code language: JavaScript (javascript)
  • Paste the URL above.
retrieve a list of events

Then click Send

Response:

The API will return all events in your Shopify. 

{ "events": [ { "id": 35983479242815, "subject_id": 49072865343, "created_at": "2019-11-10T00:07:38+09:00", "subject_type": "Blog", "verb": "create", "arguments": [ "News" ], "body": null, "message": "Blog was created: <a href=\"https://hexasync.myshopify.com/admin/blogs/49072865343\">News</a>.", "author": "Shopify", "description": "Blog was created: News.", "path": "/admin/pages" }, { "id": 35983479767103, "subject_id": 154864615487, "created_at": "2019-11-10T00:07:40+09:00", "subject_type": "Collection", "verb": "create", "arguments": [ "Home page" ], "body": null, "message": "Collection was created: <a href=\"https://hexasync.myshopify.com/admin/collections/154864615487\">Home page</a>.", "author": "Shopify", "description": "Collection was created: Home page.", "path": "/admin/collections/154864615487" }, { "id": 35983510077503, "subject_id": 154864615487, "created_at": "2019-11-10T00:09:24+09:00", "subject_type": "Collection", "verb": "published", "arguments": [ "Home page" ], "body": null, "message": "Collection was published on Online Store: <a href=\"https://hexasync.myshopify.com/admin/collections/154864615487\">Home page</a>.", "author": "Shopify", "description": "Collection was published on Online Store: Home page.", "path": "/admin/collections/154864615487" }, { "id": 35984440721471, "subject_id": 4356022435903, "created_at": "2019-11-10T01:01:44+09:00", "subject_type": "Product", "verb": "create", "arguments": [ "Acer Laptop Computer", "api_client_id", 1830279 ], "body": null, "message": "Team Beehexa created a new product: <a href=\"https://hexasync.myshopify.com/admin/products/4356022435903\">Acer Laptop Computer 2019</a>.", "author": "Team Beehexa", "description": "Team Beehexa created a new product: Acer Laptop Computer 2019.", "path": "/admin/products/4356022435903" }, { "id": 35984441573439, "subject_id": 4356022435903, "created_at": "2019-11-10T01:01:47+09:00", "subject_type": "Product", "verb": "published", "arguments": [ "Acer Laptop Computer", "api_client_id", 1830279 ], "body": null, "message": "Team Beehexa published a product on Online Store: <a href=\"https://hexasync.myshopify.com/admin/products/4356022435903\">Acer Laptop Computer 2019</a>.", "author": "Team Beehexa", "description": "Team Beehexa published a product on Online Store: Acer Laptop Computer 2019.", "path": "/admin/products/4356022435903" }, { "id": 35984501932095, "subject_id": 4356025385023, "created_at": "2019-11-10T01:05:22+09:00", "subject_type": "Product", "verb": "create", "arguments": [ "Lego 500 piece set", "api_client_id", 1830279 ]
Code language: JSON / JSON with Comments (json)
response_retrieve a list of events

The above are all steps to retrieve a list of events using Postman with Shopify API. If you have any questions, let us know in the comment below or refer to our Shopify api documentation.

These steps will be shown visually in the video below.

Shopify API – How to retrieve a list of events using Postman

Hopefully, you can do it!

Shopify API - How to retrieve a list of events using Postman

Shopify API – How to retrieve a list of events using Postman

Join The Ride

Subscribe to our fortnightly newsletter with stories from our latest adventures and the best travel tips

Table of Contents