【问题标题】:How does the ShopifySharp Webhook.Address property get mapped to the callbackUrl property of the WebhookSubscription?ShopifySharp Webhook.Address 属性如何映射到 WebhookSubscription 的 callbackUrl 属性?
【发布时间】:2021-03-26 16:22:05
【问题描述】:

我开发了一个示例 Shopify 应用程序,它在 ShopifySharp 库的帮助下成功订阅了产品/更新 webhook。我也能够成功接收和处理产品更新事件。

当我深入研究 ShopifySharp 源代码 (https://github.com/nozzlegear/ShopifySharp/blob/master/ShopifySharp/Entities/Webhook.cs) 并与 Shopify 的文档 (https://shopify.dev/docs/admin-api/graphql/reference/events/webhooksubscription?api%5Bversion%5D=2021-01#fields-2020-04) 进行比较时,Shopify 的 WebhookSubscription 对象确实没有有一个名为 Address 的属性。它实际上有一个名为“endpoint”的字段。

所以,一切正常,但我找不到让这一切发生的“秘诀”。我错过了什么?

【问题讨论】:

    标签: c# webhooks shopifysharp


    【解决方案1】:

    我找错地方了。我应该查看的是 REST API 参考而不是 GraphQL 参考:

    https://shopify.dev/docs/admin-api/rest/reference/events/webhook#index-2021-01

    REST API 确实使用了“地址”属性。

    【讨论】:

      猜你喜欢
      • 2017-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-18
      • 1970-01-01
      • 2018-09-15
      • 2012-04-01
      • 1970-01-01
      相关资源
      最近更新 更多