How to use the post_poll method in Zapier CLI

拈花ヽ惹草 提交于 2019-12-02 08:03:35

Nice, so you're almost there! CLI apps don't have pre_ and post_ poll methods. Instead, you put any manipulation after the response comes in.

const listEvents = (z, bundle) => {
console.log('listing events.. ');
let client_id = bundle.inputData.client_id;
const requestOpts = {
    url: `https://wccqa.on24.com/wcc/api/v2/client/${client_id}/event`  
};

return z.request(requestOpts)
        .then((response) => {
            return z.JSON.parse(response.content);
        })
        .then(data => {
            const events = data.events; // array of events
            return events.map(function(e){ // returns array of objects with `id` defined
                e.id = e.event_id
                return e
            }) 
        })
};
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!