删除Webhooks

时间:2012-07-31 19:12:25

标签: shopify webhooks

我有一家商店,可以阅读订单和产品。我设置了一些Webhooks,现在我想删除它们。我收回401错误。

Starting with 4 webhooks
Trying to delete webhook 1982492
Error nil, Failed.  Response code = 401.  Response message = Unauthorized.
Trying to delete webhook 1982494
Error nil, Failed.  Response code = 401.  Response message = Unauthorized.
Trying to delete webhook 1982496
Error nil, Failed.  Response code = 401.  Response message = Unauthorized.
Trying to delete webhook 1982498
Error nil, Failed.  Response code = 401.  Response message = Unauthorized.
Ended with 4 webhooks

那么,如何删除产品和订单上的Webhooks?

3 个答案:

答案 0 :(得分:2)

卸载应用程序时会自动删除应用程序创建的Webhooks(和ScriptTags)。看起来这可能就是这里发生的事情。

如果你这样做是为了回应app / uninstalled webhook,那就没有理由了。它已经处理好了!

答案 1 :(得分:2)

如果删除webhook连接的端点,则会在19次尝试连接后删除该端点。

来自shopify docs(http://wiki.shopify.com/WebHook#Automatic_Retries_and_Deletion)

  

如果在发送webhook时返回错误或发生超时,   Shopify将使用指数重试相同的请求48小时   退避方式。共计19次尝试交付   信息。

您也可以删除该应用,它会删除网络链接

答案 2 :(得分:1)

这是与我的Shopify控制台的对话,以显示它正常工作:

$ shopify console
using iliketurtles.myshopify.com
irb(main):001:0> include ShopifyAPI
=> Object
irb(main):002:0> w = Webhook.create topic: "orders/create", address: "http://whatever.place.com", format: "json"
=> #<ShopifyAPI::Webhook:0x007f8ff1895778 @attributes={"topic"=>"orders/create", "address"=>"http://whatever.place.com", "format"=>"json", "id"=>2026848, "created_at"=>"2012-08-10T15:11:25-04:00", "updated_at"=>"2012-08-10T15:11:25-04:00"}, @prefix_options={}, @persisted=true, @remote_errors=nil, @validation_context=nil, @errors=#<ActiveResource::Errors:0x007f8ff18948c8 @base=#<ShopifyAPI::Webhook:0x007f8ff1895778 ...>, @messages={}>>
irb(main):003:0> w.destroy
=> #<Net::HTTPOK 200 OK readbody=true>

正如其他人所说,我认为您的问题与权限相关。