Zapier Webhooks 发布 Json 数组

Zapier Webhooks Posting Json Array

我无法将 Zapier 的 webhooks 设置为 post 真正的 JSON 数组。

我希望 webhook post 数据是这样的:

{
    "attachments": [
    {
        "color": "danger",
        "fallback": "My fallback text is here", 
        "title": "My Title is here",
        "text":" foo"
    }
    ]
}

但我只能得到这个(注意缺少的“[”和“]”)。如何从 Zapier 的 webhooks 获得格式正确的 JSON 数组?

{
"attachments": 
    {
    "color": "danger", 
    "text": "foo", 
    "fallback": "My fallback text is here", 
    "title": "My Title is here"
    }
}

这是我的 Zapier Webhook 配置的样子:

默认的 Webhooks > "POST" 操作将负载值(包括那些看起来像数组的值)强制转换为字符串,因此您不能以这种方式发送数组值。

您应该使用 "Custom Request" 操作,而不是 "POST" 操作。

此操作允许您指定原始 JSON 负载。只要 JSON 语法正确,您就可以在对象文字中的任何位置插入前面步骤中的字段。