0

我有一家商店,有权读取|写入订单和产品。我设置了一些 Webhook,现在我想删除它们。我正在返回 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?

4

3 回答 3

3

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

如果您这样做是为了响应应用程序/已卸载的 webhook,则没有理由。已经处理好了!

于 2012-08-01T02:14:57.663 回答
2

如果您删除了 webhook 连接的端点,它将在 19 次尝试连接后被删除。

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

如果在发送 webhook 时返回错误或发生超时,Shopify 将使用指数回退方法重试同一请求 48 小时。总共将进行 19 次尝试来传递信息。

您也可以只删除应用程序,它会删除 webhook

于 2012-08-09T00:51:33.853 回答
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>

正如其他人所提到的,我认为您的问题与权限有关。

于 2012-08-10T19:13:32.870 回答