Tag: webhooks

为什么电报设置webhook后不发送更新?

我可以通过Telegram getUpdates API获取更新,而在使用有效的SSL证书或自签名证书设置webhook后,它会显示: {"ok":true,"result":true,"description":"Webhook was set"} 但它不会发送任何更新到我的webhook链接(我检查了Nginx和node.js访问日志文件),我尝试了很多curl命令为setWebhook API与没有证书,但仍然没有结果: curl -s -X POST https://api.telegram.org/bot<TOKEN>/setWebhook -d url='https://www.example.tech/<TOKEN>/webhook' jq . curl -F "url=https://www.example.tech/<TOKEN>/webhook" -F "certificate=@./www_example_tech.crt" https://api.telegram.org/bot<TOKEN>/setWebhook

Nodejs – Expressjs – validationwebify的shopify

我正在尝试validation在开发环境中从shopify webhook发送的hmac代码。 然而shopify不会发送一个webhook发送到一个非活的端点的请求,所以我使用requestbin捕获请求,然后使用postman发送到我的本地networking服务器。 从shopify 文档 ,我似乎做的一切正常,也尝试应用在node-shopify-auth verifyWebhookHMAC函数中使用的方法。 但迄今为止这一切都没有奏效。 代码从来不匹配。 我在这里做错了什么? 我的代码来validationwebhook: function verifyWebHook(req, res, next) { var message = JSON.stringify(req.body); //Shopify seems to be escaping forward slashes when the build the HMAC // so we need to do the same otherwise it will fail validation // Shopify also seems to replace '&' with \u0026 … […]

webhook是什么意思?

我已经阅读http://en.wikipedia.org/wiki/Webhook,但我仍然不清楚webhook的概念。 我对webhook有以下怀疑: 任何人都可以用真实世界的例子来解释webhook的用法吗? 2.为什么我要在应用程序中使用webhook?

通配符或正则expression式节点在中间件上表示装载path

我想定义不同的中间件,具体取决于path的外观。 事情是,path可能会警惕; 我想例如支持以下path: /chat/auth/test /chat/auth/add /chrome/auth/test /chrome/add 每次auth在path中,我都希望auth中间件被调用, 聊天和chrome我希望他们各自的中间件被调用。 app.js: // Middleware authentication var chatAuthenticate = require('./server/middleware/chat-authenticate'); app.use('/chat', chatAuthenticate(addon)); var authAuthentication = require('./server/middleware/auth-authenticate'); app.use('/auth', authAuthentication()); 我明白,我可以添加多个条目到app.js的每个可能的组合,如/ chat / auth和/ chrome / auth,它不会增加复杂性,但我只是好奇,如果有可能解决这与通配符或正则expression式:)

试图嘲笑github webhook请求,得到:“X-Hub-Signature不匹配blob签名”

这是一个小代理服务器设置来处理github webhooks: require('dotenv').config(); var http = require('http'); var createHandler = require('github-webhook-handler'); var handler = createHandler({ path: '/webhook', secret: process.env.GIT_WEBHOOK_SECRET }); http .createServer(function(req, res) { handler(req, res, function(err) { res.statusCode = 404; res.end('no such location'); }); }) .listen(8080); handler.on('error', function(err) { console.error('Error:', err.message); }); handler.on('push', function(event) { console.log( 'Received a push event for %s to %s', […]

如何validation超级webhook api?

优步文件说 此字段的值是webhook HTTP请求正文的hexHMAC签名,使用客户端密钥作为密钥,SHA256作为哈希函数。 但是HTTP请求体是什么? 我认为这是从webhook( https://developer.uber.com/docs/webhooks#section-example-post )收到的JSON正文。 如果是这样,那么如何在NodeJS中validation它作为HMAC的encryption模块不接受JSON [我尝试过JSONstring化,但它会生成一个不同的哈希]。 或者如何将JSON转换为缓冲区,因为这是下一个最佳select 如果不是,那我该用什么? [UPDATE1]用于任务的代码: app.post("/",function(req,res){ const crypto = require('crypto'); var input = res.body var str_input=JSON.stringify(input) const hmac = crypto.createHmac('sha256', '<CLIENT SECRET>'); hmac.update(str_input); console.log(hmac.digest('hex')); // print same as below console.log("e034ac7db29c3c0c10dfeced41a6cd850ed74c1c3c620863d47654cc7390359a") })

抓住webhook node.js

我正在尝试捕获由Node.js中的Aftership API所做的PUT / webhook请求。 每次需要做推送通知时都会发出一个PUT请求,我正在使用Parse发送通知,但是我需要一些来自webhook的数据。 webhook的标题看起来像Content-Type: application/json并包含这些数据: ts – 事件发生的UTC unix时间戳 事件 – 事件的名称(用于跟踪更新,值将为'tracking_update') msg – 有关事件发生的消息的详细信息,格式如下。 我将如何去得到跟踪号码,slug和token值在节点或js中的自定义字段字典? { "event": "tracking_update", "msg": { "id": "53aa94fc55ece21582000004", "tracking_number": "906587618687", "title": "906587618687", "origin_country_iso3": null, "destination_country_iso3": null, "shipment_package_count": 0, "active": false, "order_id": null, "order_id_path": null, "customer_name": null, "source": "web", "emails": [], "custom_fields": {}, "tag": "Delivered", "tracked_count": 1, "expected_delivery": null, […]

如果我的服务器无法接收,请问Stripe API重试一个Webhook请求?

如果我设置了一个Stripe Webhook向http://my.website.io发送请求,但是无论什么原因,我的服务器在closures的时候无法处理请求,Stripe会重试请求吗? 还是我需要负责轮询他们,以确保我的数据副本是最新的? 在Stripe关于重试Webhook请求的文档中我找不到任何东西(我可以理解为什么他们不会),但我只是想确保我不会错过它。 提前致谢!

内容和节点的Webhooks

真的很努力得到这个工作。 我在Contentful中有一个webhook定义设置。 当我在Contentful中发布条目时,它会向webhooks.example.com发送一个HTTP POST请求。 在该子域中,我有一个运行的NodeJS服务器来接受请求。 我查看了Contentful API文档 ,它说请求主体应该包含新发布的条目。 我已经尝试了两种接收请求的方法,这两种方法都不会给请求主体任何东西。 首先,我尝试了有意义的webhook-server NPM模块: var webhooks = require("contentful-webhook-server")({ path: "/", username: "xxxxxx", password: "xxxxxx" }); webhooks.on("ContentManagement.Entry.publish", function(req){ console.log("An entry was published"); console.log(req.body); }); webhooks.listen(3025, function(){ console.log("Contentful webhook server running on port " + 3025); }); 这里的请求来了,我得到消息An entry was published但req.body是未定义的。 如果我做了console.log(req) ,我可以看到完整的request对象,它不包含body。 于是我试着运行一个基本的Express服务器来接受所有的POST请求: var express = require("express"), bodyParser = […]

Mailgun的webhook POST身体似乎是空的

我正试图处理来自Mailgun反弹webhook的http post消息。 当发送给Mailgun的Postbin服务时,当然会发现所有的数据。 但我现在发送POST到我的本地服务器的发展目的,我得到的是空的JSON数组。 我使用testingWebhook。 意图是尽可能简单,除了我们的主要服务。 对于我开始使用nodejs / expressjs来创build独立的web服务来作为中继接收来自Mailgun邮件反弹的POST消息并通知pipe理员关于退回的电子邮件地址。 现在我不明白为什么我不能得到相同的数据,在Postbin中可见。 var express = require('express'); var app = express(); var bodyParser = require('body-parser'); var mailgun = require('mailgun-js')({apiKey: 'key-…', domain: 'mymailgundomain.com'}); app.use(bodyParser.urlencoded({ extended: true })); function router(app) { app.post('/webhooks/*', function (req, res, next) { var body = req.body; if (!mailgun.validateWebhook(body.timestamp, body.token, body.signature)) { console.error('Request came, but not […]