标签: webhooks

如何从 Mailgun 在 ASP.NET C# 中接收 HTTP POST?

http://documentation.mailgun.net/quickstart.html包含 Django 中 http 处理程序的一些示例代码:

    # Handler for HTTP POST to http://myhost.com/messages for the route defined above
    def on_incoming_message(request):
    if request.method == 'POST':
     sender    = request.POST.get('sender')
     recipient = request.POST.get('recipient')
     subject   = request.POST.get('subject', '')

     body_plain = request.POST.get('body-plain', '')
     body_without_quotes = request.POST.get('stripped-text', '')
     # note: other MIME headers are also posted here...

     # attachments:
     for key in request.FILES:
         file = request.FILES[key]
         # do something with the file

 # Returned text is ignored but HTTP status code matters:
 # Mailgun wants to …
Run Code Online (Sandbox Code Playgroud)

.net c# http webhooks

2
推荐指数
1
解决办法
8706
查看次数

Ruby on Rails:从 webhook 捕获 JSON 数据?

我试图了解 webhook 是如何工作的。我的理解是它能够连接两个不同的应用程序。如果我提交一个带有 url 的 webhook

本地主机:3000/接收器

到一个应用程序,我的应用程序有一个方法

def receiver

end
Run Code Online (Sandbox Code Playgroud)

我想知道如果我不知道来自 webhook 的回调是什么,我将如何捕获数据?如何保存与我的应用程序通信的任何 JSON 数据?我在想也许可以保存一些文件以查看对象是什么,但我还是个新手,不确定如何捕获 JSON 数据?

谢谢

json ruby-on-rails webhooks ruby-on-rails-3 ruby-on-rails-3.2

2
推荐指数
1
解决办法
1901
查看次数

Jenkins + GitHub插件webhooks无法正常工作

我正在使用最新的(v1.10)Jenkins GitHub插件,Jenkins v1.1我的webhook集成失败并出现错误:

java.lang.IllegalArgumentException: Github Webhook event of type ping is not supported. Only push events are current supported
Run Code Online (Sandbox Code Playgroud)

看起来GitHub正在使用某种不支持的"ping"事件.或者有一些配置缺失?

github webhooks jenkins

2
推荐指数
1
解决办法
2633
查看次数

使用 nginx 的 lua 验证 GitHub webhooks 并删除 cron-lock-file

我拥有的:

  • GNU/Linux 主机
  • nginx 已启动并运行
  • 有一个 cron-job 计划在删除特定文件后立即运行(类似于 run-crons)
  • 当有人推送到存储库时,GitHub 会发送一个 Webhook

我想要的是:

我现在确实想运行 lua 或任何类似的东西来解析 GitHub 的请求并验证它,然后删除一个文件(当然,如果请求有效)。

最好所有这一切都应该在没有维护额外 PHP 安装的麻烦的情况下发生,因为目前没有,或者需要使用 fcgiwrap 或类似的。

模板:

在 nginx 方面,我有相当于

location /deploy {
    # execute lua (or equivalent) here
}
Run Code Online (Sandbox Code Playgroud)

lua json github nginx webhooks

2
推荐指数
1
解决办法
1073
查看次数

是否可以通过php和telegram api控制真实的电报帐户

我想用 php 控制一个 Telegram 账户!是否可以像那样连接到电报?因为我在我的一个小组中看到了这样的机器人!使用的是手机号码而不是botfather key!

php webhooks telegram php-telegram-bot

2
推荐指数
1
解决办法
1160
查看次数

如何获取 webhook 响应数据

我还是网络钩子的新手。我在这里需要做的是每当在名为 Bizzabo 的注册平台上有新注册时进行回调。该平台通过让我们放置端点 URL 并选择将触发 Webhook 的操作来提供 Webhook 集成。我还使用了 Request Bin,它可以很好地显示数据。

但是,如何回显 JSON 正文数据,例如它在我的界面 URL php 中的请求箱中的显示方式?

这是 Webhook 集成在 Bizzabo 上的样子

使用 Request Bin 测试时从 Webhook 捕获的数据

谢谢!

php json webhooks

2
推荐指数
1
解决办法
7222
查看次数

通过Dialogflow Webhook实现向Google的Actions发送丰富的响应

为了使Google助手能够向用户显示丰富的响应,必须向其提供响应,例如Google文档上的操作中示例。但是,由于我将Dialogflow用作服务器和Google之间的中介方,因此我需要在Webhooks中提供对Dialogflow的某种响应,以表明应该有丰富的响应。从该链接可以看到,该文档提到了如何向FB Messenger,Kik,LINE等发送丰富的响应,但没有向Google Assistant发送响应。

我在这里想念什么?我在Dialogflow Web控制台中看到了用于丰富响应的选项,但在这里似乎只能输入硬编码的响应,而没有来自服务器的动态数据。什么是正确的方法?

在此处输入图片说明

webhooks fulfillment actions-on-google dialogflow-es

2
推荐指数
1
解决办法
4238
查看次数

在 Go 中验证 GitHub Webhook HMAC 签名

我编写了以下函数来验证X-Hub-Signature由 GitHub API 返回的请求标头作为 webhook 负载的一部分。

func isValidSignature(r *http.Request, key string) bool {
    // Assuming a non-empty header
    gotHash := strings.SplitN(r.Header.Get("X-Hub-Signature"), "=", 2)
    if gotHash[0] != "sha1" {
        return false
    }
    defer r.Body.Close()

    b, err := ioutil.ReadAll(r.Body)
    if err != nil {
        log.Printf("Cannot read the request body: %s\n", err)
        return false
    }

    hash := hmac.New(sha1.New, []byte(key))
    if _, err := hash.Write(b); err != nil {
        log.Printf("Cannot compute the HMAC for request: %s\n", err)
        return false
    }

    expectedHash := …
Run Code Online (Sandbox Code Playgroud)

go webhooks hmacsha1 github-api

2
推荐指数
1
解决办法
1093
查看次数

Stripe webhook 错误:找不到与有效负载的预期签名匹配的签名

我正在使用 Stripe 提供的代码来测试 webhook。Stripe 机密和端点机密已经过三重检查。

条纹版本:6.19 Body-Parser:1.19

当我在 Stripe 仪表板上测试 webhook 时,我得到了结果:(测试 webhook 错误:400)没有找到与负载的预期签名匹配的签名。您是否正在传递从 Stripe 收到的原始请求正文?

任何帮助,将不胜感激。

var bodyParser - require('body-parser);


// Using Express
const app = require('express')();

app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());


// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
const stripe = require('stripe')('sk_test_VPw...');

// Find your endpoint's secret in your Dashboard's webhook settings
const endpointSecret = 'whsec_...';


// Use body-parser to retrieve the raw …
Run Code Online (Sandbox Code Playgroud)

webhooks node.js express stripe-payments

2
推荐指数
3
解决办法
6029
查看次数

Google Apps 脚本中的去抖或节流事件处理程序

我正在寻找一种巧妙的解决方案来消除或限制 Google Sheets Apps 脚本处理程序中使用的 webhook 调用。onEdit为其他更改创建一个简单的触发器或“可安装的触发器”很简单,但两者都会为每个更改调用处理程序。如果有人正在编辑工作表并在几秒钟内更新了许多行,我只想触发一个事件而不是淹没我的 webhook 服务。Javascript 中的常规模式是使用setTimeoutclearTimeout确保事件处理程序的主体仅被调用一次,但setTimeout在 Google Apps Script 运行时中不可用。

javascript webhooks google-sheets google-apps-script

2
推荐指数
1
解决办法
372
查看次数