The Linux Page

REST hook trigger needs a polling url (ZSE007)

As I'm working on a Zap application (see Zapier). I got this error about my triggers:

REST hook trigger needs a polling url (ZSE007)

So... I understand that they want to have a URL to do a poll and they even have documentation that explains why they want to poll in case of a REST hook Zap: Whenever the user wants to test the Zap, the application will get some data using the polling method. That way they can get that data specifically for one test and not force you to generate an trigger. One problem with testing with an actual trigger is that any other Zap listening to the same trigger would wake up too.

Looking around the Internet I could not find a solution to the riddle... until I though I would check that one other perform definiton, it's called performList. And to my surprise that was what was required.

The solution is to write a function or a set of instruction for an HTTP request.

const message_failed_perform_list = (z, bundle) =>
{
     // your request magic goes here
};

module.exports =
{
    ...,
    operation:
    {
        ...
        performList: my_perform_list,
        ...
    },
};

Yes.

"performList" == "polling url"

Who knew?

As a side note, in the docs they say NOT to use performList, but instead to look into using resource. Since I have no clue how their resources are working, I'll use the performList for now. But on your end you may want to do some more reseach and see how to use the resources.