What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to add webhooks from an external application?

How to add webhooks from an external application?

djachim
Shopify Partner
3 0 0

I am trying to call the webhooks.json API from outside of Shopify.  How can I do that?
Attempt #1:

 

 

 

POST https://<CLIENT_ID>:<CLIENT_SECRET>@<SHOP_NAME>.myshopify.com/admin/api/2023-07/webhooks.json
with body: {"webhook":{"address":"https://mywebhook.url","topic":"customers/update","format":"json"}}

returns html response: with redirect link
https://accounts.shopify.com/oauth/authorize?client_id=...

 

 

 

 Attempt #2:

 

 

 

POST https://<SHOP_NAME>.myshopify.com/admin/api/2023-07/webhooks.json
with headers: X-Shopify-Access-Token: <TEMPORARY_TOKEN>
with body: {"webhook":{"address":"https://mywebhook.url","topic":"customers/update","format":"json"}}

returns json response: 
{"errors": "[API] Invalid API key or access token (unrecognized login or wrong password)"}

 

 

 

 

 

Replies 0 (0)