Zapier:修改Webhook侦听器HTTP响应? [英] Zapier: modification of webhook listener HTTP response?

查看:51
本文介绍了Zapier:修改Webhook侦听器HTTP响应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

某些API在webhook侦听器响应中需要其他信息.例如,我正在尝试订阅Outlook.com的推送通知服务,该服务描述了以下流程:

Certain API's require additional information in the webhook listener response. For example, I'm trying to subscribe to Outlook.com's push notification service, which describes the flow below:

"Outlook通知服务尝试使用侦听器服务验证通知URL.它在验证请求中包括验证令牌.

"The Outlook notifications service tries to validate the notification URL with the listener service. It includes a validation token in the validation request.

如果侦听器服务成功验证了URL,它将在5秒内返回成功响应,如下所示:

If the listener service successfully validates the URL, it returns a success response within 5 seconds as follows:

将响应头中的内容类型设置为text \ plain.在响应正文中包含相同的验证令牌.返回HTTP 200响应代码.侦听器可以随后丢弃验证令牌."

Sets the content type in the response header to text\plain. Includes the same validation token in the response body. Returns an HTTP 200 response code. The listener can discard the validation token subsequently."

Zapier 使用 200 响应代码进行响应,并在 webhook url 中捕获验证令牌,但如何修改 HTTP 响应以在其对来自 Microsoft 通知服务的 POST 事件的响应中包含验证令牌?

Zapier responds with the 200 response code, and catches the validation token in the webhook url, but how do I modify the HTTP response to include the validation token in its response to the POST event from Microsoft's notification service?

推荐答案

我认为您无法更改实际的Webhook输出/响应.测试时,我总是会返回JSON-类似于:

I don't think you can alter the actual webhook output/response. When testing I always get JSON back - similar to this:

{状态":成功"尝试":"578ebd7e-0831-4f9d-a5ef-b6adc72d3ba0""id":"18a4c58c-3257-4bc9-9bf8-7493d19b0d64""request_id":"fMBT1iHLOloZYRSM"}

这甚至在我设置了一个接受webhook数据(作为自定义触发器)的自定义Zapier应用程序,然后使用

This is even after I set up a custom Zapier app that accepts webhook data (as a custom trigger), and then adjusted the response content and headers using Zapier scripting for catching webhooks:

var Zap = {test_webhook_catch_hook:函数(捆绑){bundle.request.content =自定义响应";返回bundle.request;}};

此操作唯一要做的就是更改发送到下一个Zapier动作的响应.

The only thing this actually does is change the response that gets sent into the next Zapier action.

这篇关于Zapier:修改Webhook侦听器HTTP响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆