gpt4 book ai didi

arrays - Zapier Webhooks 发布 Json 数组

转载 作者:行者123 更新时间:2023-12-04 18:25:51 24 4
gpt4 key购买 nike

我无法让 Zapier 的 webhooks 发布真正的 JSON 数组。

我希望 webhook 发布数据是这样的:

{
"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 配置的样子:

enter image description here

最佳答案

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

您应该使用“自定义请求”操作而不是“POST”操作。


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

关于arrays - Zapier Webhooks 发布 Json 数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43161861/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com