HTTP Trigger : New Event (Polling)
How you can use Workato to setup up a Polling Trigger
Common applications' API may not always support Webhooks functionality, but provide a means to gather data in a filtered manner. With these endpoints, you can easily set up a periodically polling trigger that calls for data.
Webhook Triggers and Polling triggers are very similar in terms of each fields, but its functionality differences largely shines from how they interpret the Response Body Sample. For all other fields, including how to set up an OAuth connection,check it out here.
The polling trigger works well for most of the endpoints that work with GETs, ussually endpoints that query a list of objects instead of querying details for a specific record given an ID.
Examples :
This endpoint from Typeform can also be utilized for picking up details from a form named Ab12C3
https://api.typeform.com/v1/form/Ab12C3?key=zx032900ff72f6d095b7cfba37522c00dfb8dfcd
Or this endpoint from Spotify that can be also utilized for picking up playlists
Fields
URL
The URL section is where you set up the API Endpoint. This is where you specify the endpoints of the API. Generally, this endpoint will most probably be of a GET action.
Request Headers
Depending on the API, you may need to provide a few request headers
Response Type
Response type defines the format that the returned data should be in. This will be the format used by Workato to parse any returned data into the App Data section.
Response Body Example
By providing an example document, Workato will be able to match incoming data with this example to provide a parsed data tree in the App Data section. For example, a sample response body of :
{ "items": [ {"title":"Car", "year":"1924"}, {"title":"Computer","year":"1993"} ] }
If you aren't familiar with JSON format, this tutorial should give you a crash course in understanding it. One thing to note here is that although Items is a list item, the app data does not show it as such. This is because a polling trigger will process each item at runtime instead of the whole list.
Array path (required)
The array path field will only appear if the Sample Response Body has been parsed correctly. In this field, you will need to specify the object that you intend to pick up, such as Items as in the case of the above Sample Response.
ID column (required)
As Workato triggers has built-in deduplication functionality, it is important that each record that Workato picks up has a unique identifier field to work with. Such is the case with ID column. This is where you should pick a field value that can uniquely identify each objects that originates from the List Items from Array Path
TimeStamp Column
A timestamp column is not compulsory, but will be useful if you wish to pick up objects that are either newly created or updated events. Choose a timestamp that correctly tells the latest updated time. The specified timestamp will then be used together with the ID column to create a unique identifier that works with updated objects.
Here is also a featured recipe to show you a very simple example of how Polling Trigger works. Make sure that a few things are changed before you can run this recipe successfully for your recipe.
HTTP Oauth2 (Polling) Example recipe
This allows you to use the data from the application as an App Data on the subsequent actions in your recipe.
Once all is set up, simply run the recipe, and watch as data comes through!