get all webhook via API

keyur_shopify
Shopify Partner
20 0 1

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.

Replies 15 (15)

KarlOffenberger
Shopify Partner
1873 184 899

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.

keyur_shopify
Shopify Partner
20 0 1

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.


 

KarlOffenberger
Shopify Partner
1873 184 899

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.

keyur_shopify
Shopify Partner
20 0 1

I exactly not understand.so please clarify more. 

keyur_shopify
Shopify Partner
20 0 1

Please give a needfull reply I have stuck on this issue.


@keyur_shopify wrote:

I exactly not understand.so please clarify more. 


 

KarlOffenberger
Shopify Partner
1873 184 899

@keyur_shopify  There's nothing I can add to my previous reply to explain it any simpler.

keyur_shopify
Shopify Partner
20 0 1

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.


 

Busfox
Shopify Staff (Retired)
628 49 110

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.

KarlOffenberger
Shopify Partner
1873 184 899

@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?

 

gxVzKQF

 

Am I missing something here?

 

p.s. please don't make me post a new topic 😄

a5e
Excursionist
17 1 9

@KarlOffenberger in the webhook listing on the right of each webhook you should see this :

ocbsK7f

keyur_shopify
Shopify Partner
20 0 1

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?

 

gxVzKQF

 

Am I missing something here?

 

p.s. please don't make me post a new topic 😄




keyur_shopify
Shopify Partner
20 0 1

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?

 

gxVzKQF

 

Am I missing something here?

 

p.s. please don't make me post a new topic 😄







a5e
Excursionist
17 1 9

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.





KarlOffenberger
Shopify Partner
1873 184 899

@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.

A_P_Learner
New Member
4 0 0

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.