【问题标题】:Webhook - verification - OPTIONS method to verify if POST request are allowed - Integromat SDKWebhook - 验证 - 验证是否允许 POST 请求的 OPTIONS 方法 - Integromat SDK
【发布时间】:2021-11-06 21:37:21
【问题描述】:

我需要验证Webhook Attach from Integromat SDK

GoToConnect Webhook registration aka NotificationChannel 需要来自 OPTIONS 请求的响应,以验证它是否允许 POST 请求。

所以,我使用 Integromat SDK 编写 Webhook 定义,如下所示:

  • Webhook - api.imljson
{
    "output": "{{body}}",
    "verification": {
        //"condition": "{{ if(headers.method == 'OPTIONS', true, false) }}",
        "condition": true,
        "respond": {
            "status": "200",
            //"type": "urlencoded",
            "body": {},
            "headers": {}
        }
    }
}
  • Webhook - attach.imljson
{
    "url": "https://api.jive.com/notification-channel/v1/channels/{{parameters.channelNickname}}",
    "method": "POST",
    "body": {
        "channelType": "Webhook",
        "webhookChannelData": {
            "webhook": {
                "url": "{{webhook.url}}"
            }
        },
        //"channelLifetime": "{{ifempty(parameters.channelLifetime, 15552000)}}"
        "channelLifetime": "{{ parameters.channelLifetime }}"
    },
    "response": {
        "data": {
            "externalHookId": "{{body.channelId}}",
            "externalHookNickname": "{{body.channelNickname}}",
            "channelId": "{{body.channelId}}",
            "channelNickname": "{{body.channelNickname}}",
            "channelLifetime": "{{body.channelLifetime}}",
            "doNotDisturbAware": "{{body.doNotDisturbAware}}"
        }
    }
}
  • Webhook - dettach.imljson
{
    "url": "https://api.jive.com/notification-channel/v1/channels/{{ webhook.channelNickname }}/{{ webhook.channelId }}",
    "method": "DELETE"
}

但它并没有像预期的那样工作

是否有正确的方法来完成对 OPTIONS 请求的验证?

【问题讨论】:

    标签: integromat integromat-apps


    【解决方案1】:

    Integromat 的支持回复了我已打开的工单。

    所以,我在定义中使用了Shared Webhook,在这种情况下,必须是Dedicated Webhook,因为它必须从 Integromat 发送 URL 来注册 webhook。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-01-15
      • 1970-01-01
      • 2015-02-09
      • 2018-02-26
      • 2018-03-23
      • 1970-01-01
      • 2020-09-19
      相关资源
      最近更新 更多