0

我需要验证来自 Integromat SDK 的 Webhook Attach

GoToConnect Webhook 注册又名 NotificationChannel需要来自OPTIONS请求的响应以验证它是否允许POST请求。

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

  • 网络挂钩 -api.imljson
{
    "output": "{{body}}",
    "verification": {
        //"condition": "{{ if(headers.method == 'OPTIONS', true, false) }}",
        "condition": true,
        "respond": {
            "status": "200",
            //"type": "urlencoded",
            "body": {},
            "headers": {}
        }
    }
}
  • 网络挂钩 -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}}"
        }
    }
}
  • 网络挂钩 -dettach.imljson
{
    "url": "https://api.jive.com/notification-channel/v1/channels/{{ webhook.channelNickname }}/{{ webhook.channelId }}",
    "method": "DELETE"
}

但它没有按预期工作

GoToConnect NotificationChannel 的应用程序模块 webhook 的打印

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

4

1 回答 1

0

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

因此,我在定义中使用了共享 Webhook,在这种情况下,它必须是专用 Webhook,因为它必须从 Integromat 发送 URL 来注册 Webhook。

于 2021-11-10T00:49:38.687 回答