我需要验证来自 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"
}
但它没有按预期工作
是否有正确的方法来完成对 OPTIONS 请求的验证?