大型商家webhooks监听器在轨道 [英] BigCommerce webhooks listener in rails
问题描述
我按照这里的说明 http://developer.bigcommerce.com/api/webhooks / quickstart 设置webhook来启动一些第三方订单处理。我们一直在这样做一个小时批量,实时的webhook触发器将节省我们很多滞后时间。
I'm following the instructions here http://developer.bigcommerce.com/api/webhooks/quickstart to set up webhooks to initiate some third-party order processing. We've been doing this on an hourly batch, real-time webhook triggers will save us a lot of lag time.
我想我已经设置了webhook广播,但看不到任何证据表明它被解雇 - 我创建了一堆新订单,没有达到rails服务器。
I think I've set up the webhook broadcaster, but can't see any evidence that it's being fired- I've created a bunch of new orders and nothing reaches the rails server.
我如何告诉BigCommerce是否在何时/我希望触发事件?
为给定的应用/用户/域生成访问令牌:
Generated the access token for the given app/user/domain:
curl -XPOST -d '{
"client_id":"[BigCommerceAppClientId]",
"client_secret":"[BigCommerceAppSecret]",
"user":"admin",
"token":"[adminAPIToken]",
"store_domain":"https://[myStore].mybigcommerce.com"
}' https://hooks-beta.bigcommerce.com/token
yield = ==>
yields ===>
{
"access_token":"[webHooksAccessToken]",
"producer":"store/[myStoreKey]"
}
订阅ed to webhooks for store / events / listener:
Subscribed to webhooks for store/events/listener:
curl -XPOST -d '{
"producer":"store/[myStoreKey]",
"scope":"store/order/created",
"deliverymethod":"HTTP_POST",
"destination":{"url":"http://[myPublicRailsServer]/hooks"}
}' -H 'X-Auth-Client: [BigCommerceAppClientId]' -H 'X-Auth-Token:[X-Auth-Token]' https://hooks-beta.bigcommerce.com
yield ===>
yields ===>
{
"client_id":"[webHooksAccessToken]",
"created_at":"2013-06-27T19:57:38+00:00",
"deliverymethod":"HTTP_POST","destination":{"url":"http://[myPublicRailsServer]/hooks"},
"id":651,
"producer":"store/[myStoreKey]",
"scope":"store/order/created",
"updated_at":"2013-06-27T19:57:38+00:00"
}
推荐答案
我撒谎。问题显然是试图使用 https
而不是 http
。一切都按预期工作。
I lied. The problem was apparently trying to use https
instead of http
. Everything works as expected.
此外,BigCommerce提供了一个钩子来检查给定应用程序的活动客户端:
Furthermore- BigCommerce provides a hook to check the active clients for a given application:
curl -XGET -H
'X-Auth-Client: [BigCommerceAppClientId]' -H
'X-Auth-Token: [BigCommerceAppSecret]'
https://hooks-beta.bigcommerce.com/producer/store/[myStoreKey]
这篇关于大型商家webhooks监听器在轨道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!