在我的Zapier应用程序中,我正在调用应用程序服务器上托管的rest hook API,以传递bundle.targetUrl
Webhook URL,可以在其中报告数据并触发应用程序。
我想发送更多信息,作为该剩余挂钩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));
};