Trigger Zaps from polling webhooks

If you're on a paid plan, you can trigger Zaps from polling webhooks. In contrast to the Catch Hook trigger, which requires you to send a POST request to trigger the Zap, the Retrieve Poll trigger “polls” an endpoint for data. In other words, it allows you to send a GET request to a REST API endpoint and parse the data that is returned.

miscEye icon Note

This trigger only supports basic authentication with a username and password. If you need to query an API that requires more advanced forms of authentication, you should create your own private application on the Zapier platform.

 

1. Make sure your endpoint returns JSON in the format Zapier requires

In order to trigger properly, the Zap expects your URL to return JSON, specifically a list of dictionaries (an array of objects) in reverse chronological order (newest first, oldest last). For example, that might look like this:

[{“id”:1235, “name”:”event2”, “created_date”:”2019-04-01”},{“id”:1234, “name”:”event1”, “created_date”:”2019-01-01”}]

 

2. Enter the deduplication key

By default, Zapier looks for an “id” key, and uses that to determine whether a record is new or not, i.e. to deduplicate the records.

If the “id” key does not exist by default in your data, you have two options:

  • You may specify an alternate unique key that the Zap can use for deduplication in the Deduplication Key field.
  • If you don’t specify an alternate key, the Zap will fall back to the shortest key containing “id”.
miscEye icon Note

The field you choose as the deduplication key can be either an integer or a string field type.

 

3. Enter a child key

Often, the array containing the objects that you’d like to trigger your Zap is not top-level—instead, it may be contained within another object.

If this is the case, use the Key field to enter the key corresponding to the array that does contain the records you’d like to trigger the Zap. Note that this field does support dot notation if the array is nested more than once.

 

4. Customize your webhook trigger

The Retrieve Poll trigger also offers the ability to enter a username and password, headers, and an Xpath. If your API requires authentication or custom headers to access and parse data properly, you’ll want to take advantage of these fields!

Once you’ve set up your webhook trigger, you’re ready to continue setting up the rest of your Zap.

ratingStar icon Tip

Webhooks may delay passing on data to other steps if there are a lot of requests coming at the same time. For details on webhook throttling, read Rate limits and throttling in Zapier.

Was this article helpful?
4 out of 15 found this helpful