【发布时间】:2020-08-19 13:31:04
【问题描述】:
我构建了一个简单的 zapier 集成,它运行良好。但是,我正在添加动态字段。当我测试 zap 时,这一切似乎都运行良好。我的动态表单字段按预期显示。
问题是将这些动态表单的值发送到我的 API。我正在使用 zapier 控制台,当我配置 API 请求时,我正在使用以下内容:
body['custom_fields'] 应该发送我所有的动态字段甚至所有字段。但是当它到达我的 API 时,custom_fields 参数是空白的。
const options = {
url: 'https://example_url/endpoint',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': `Bearer ${bundle.authData.auth_token}`
},
body: {
'email': bundle.inputData.email,
'custom_fields': bundle.inputData
/**
I've tried the following with no luck:
'custom_fields': bundle.inputData.fields
'custom_fields': bundle.inputData.undefined
'custom_fields': bundle.inputData
*/
}
}
return z.request(options)
.then((response) => {
response.throwForStatus();
const results = response.json;
// You can do any parsing you need for results here before returning them
return results;
});
【问题讨论】:
-
您能否更新您的问题以包含您的
inputFields和/或动态字段生成代码?bundle.inputData应该让一切都进入 zap
标签: zapier