在我的 Zapier 应用程序中,我正在调用托管在我的应用程序服务器上的 rest hook API 以传递bundle.targetUrl
可以报告数据并触发应用程序的 webhook URL。
我想发送更多信息,作为这个 rest hook API 调用的一部分。诸如哪个动作应用程序用作此 Zap 的一部分、所有字段已在动作应用程序中映射的内容、其中哪些是必需的等。
我想要这个,以便我可以更精确地配置我的应用程序,以决定何时准确报告数据并触发 Zap。
我认为这个问题的答案在于bundle
变量。但我无法找到这个变量的确切结构,它包含的所有数据以及它是否包含有关上述 Zap 的其他数据。
作为参考,这是我的应用程序中 subscribeHook 函数的当前代码:
const subscribeHook = (z, bundle) => {
const data = {
url: bundle.targetUrl,
event: ['new_conversation'],
};
// You can build requests and our client will helpfully inject all the variables
// you need to complete. You can also register middleware to control this.
const options = {
url: `${_sharedBaseUrl}/api/v1/convbot/${bundle.inputData.chatbot}/resthook`,
method: 'POST',
json: data,
};
return z.request(options)
.then((response) => JSON.parse(response.content));
};