【发布时间】: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