6

I'm having trouble deleting Webhooks that I created thru the Shopify API. To create the webhook, I used this code in RoR:

webhook = ShopifyAPI::Webhook.create(format: "json", topic: "orders/create", address: "some address")

I'm able to send a GET request and retrieve all the webhooks that were created. But when I send the DELETE request with the respective ID, the response is "404 Not Found - errors: Not found". I'm sending the DELETE request using Firefox's RESTClient, and the format is like this:

DELETE https://api_key:shared-secret@hostname/admin/webhooks/1855159.json

Maybe it's not working because the webhooks were created via the API. Is there another way to delete the webhooks? Thanks in advance!

4

4 回答 4

4

删除/admin/webhooks/4759306.json

删除网络挂钩

从商店中删除现有的 webhook

DELETE /admin/webhooks/#{id}.json
于 2014-05-13T12:53:29.087 回答
2

我认为当您从管理面板中删除应用程序时,该应用程序创建的 webhook 会自动删除

于 2012-06-29T19:15:05.917 回答
2

这就是您删除应用程序创建的 webhook 的方式。Webhook1855159是由商店创建的,而不是由应用程序创建的,只能由商店的管理员删除。

于 2012-06-30T05:15:37.823 回答
0

您应该先检索您的 webhook,然后再删除它们。

@webhooks = ShopifyAPI::Webhook.find(:all, :params => {:limit => 10})
@webhooks.each {|webhook| webhook.destroy }
于 2021-10-21T21:58:51.563 回答