Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
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)"}