Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
We have to get all created webhook via API but don't get perfect information because when we have created my store than we have created two webhook but after that, we have created more than one webhook in my store.so, we have to get all webhook API are get old created webhook. How to solve this issue please let me know.
Either because you created the other webhooks via admin or another API key. Webhooks are scope by API key meaning that you can only GET webhooks created by that same API key used in the request - you won't be able to get webhooks created by admin ui, other apps / API keys.
We have also created webhook for Same API key and get for the same API key.so we have created another API details?
@KarlOffenberger wrote:Either because you created the other webhooks via admin or another API key. Webhooks are scope by API key meaning that you can only GET webhooks created by that same API key used in the request - you won't be able to get webhooks created by admin ui, other apps / API keys.
I don't know what you have created or not - I am just saying that this is a possibility due to how webhooks are scoped.
Just imagine it like so
- Admin / key: 111 - webhooks - id: 123 topic: orders/create - id: 124 topic: products/update - App A / key: 222 - webhooks - id: 125 topic: products/create - id: 126 topic: products/update - App B / key: 333 - webhooks - id: 127 topic: products/update
So when you request a GET using App B and key 333 via
/admin/webhooks.json
You would only get
{ "webhooks": [ { "id": 127, "topic": "products/update", ... } ] }
You wouldn't see any of the other webhooks.
I exactly not understand.so please clarify more.
Please give a needfull reply I have stuck on this issue.
@keyur_shopify wrote:I exactly not understand.so please clarify more.
@keyur_shopify There's nothing I can add to my previous reply to explain it any simpler.
We have created only one API details not to use another.so, why this issue is getting.
@KarlOffenberger wrote:@keyur_shopify There's nothing I can add to my previous reply to explain it any simpler.
To add to what @KarlOffenberger has already shared, I can see 6 webhook subscriptions on the shop associated with your forums email. If I'm looking at the wrong shop, please correct me.
4 webhook subscriptions were created from the admin's notifications page at shop.myshopify.com/admin/settings/notifications. Since webhooks are scoped to the app that created them, these would never be returned through the API.
2 webhook subscriptions were created through an app. I imagine these are the two you are seeing in the API response to the webhooks API.
You will only ever receive webhooks created by the api client fetching them.
I hope this clarifies things. If you want to fetch all webhooks, I would recommend deleting the webhooks you created in the admin, and instead creating them through the API.
Cheers
To learn more visit the Shopify Help Center or the Community Blog.
@Busfox since you mentioned it and I've been wondering for a while now - how DO you delete a webhook notification created via admin UI?
Am I missing something here?
p.s. please don't make me post a new topic 😄
@KarlOffenberger in the webhook listing on the right of each webhook you should see this :
Which key to getting all created webhooks in Shopify? I am using this URL https://removed@fine-pratical.myshopify.com/admin/webhooks.json
please let me know I am using the wrong URL.
@KarlOffenberger wrote:
@Busfox since you mentioned it and I've been wondering for a while now - how DO you delete a webhook notification created via admin UI?
Am I missing something here?
p.s. please don't make me post a new topic 😄
Which key to getting all created webhooks in Shopify? I am using this URL https://removed@fine-pratical.myshopify.com/admin/webhooks.json
please let me know I am using the wrong URL.
@keyur_shopify wrote:
Which key to getting all created webhooks in Shopify? I am using this URL https://removed@fine-pratical.myshopify.com/admin/webhooks.json
please let me know I am using the wrong URL.
@KarlOffenberger wrote:
@Busfox since you mentioned it and I've been wondering for a while now - how DO you delete a webhook notification created via admin UI?
Am I missing something here?
p.s. please don't make me post a new topic 😄
1. No its not possible. Please re-read the response from @Busfox
You will only ever receive webhooks created by the api client fetching them.
I hope this clarifies things. If you want to fetch all webhooks, I would recommend deleting the webhooks you created in the admin, and instead creating them through the API.
2. You are disclosing your full url and this is not recommended as anyone could use it to retrieve data from your shop.
@a5e Sorry, forgot to thank you for your response. I'd have assumed the same re: deleting webhooks, albeit that bin icon is exactly what is missing on my admin UI 😄 I'll open a new topic thread for that.
Hello
You are right, I am facing the same issue. I have created the 2 webhook events from the Shopify store. And then I am trying to get all the webhook event lists. But its return none webhook. So is there any official declaration for this process??? Then please send me the link for it.