• DOCUMENTATION
  • WORKATO BLOG
  • PRODUCT BLOG
  • Return to Workato
  • Log in
  • ☰
  • Community/Discussions
Solution home App Resources HTTP

HTTP Trigger : Understanding New Event (Polling)

Modified on: Sun, Dec 4, 2016 at 10:32 PM

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

Object Name
A label used for understanding your action in the context of your recipes better.

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"}
	]
}



  Will be parsed into this for steps below it : 

49bXBVLZ-Rmi4NyAMkoDpG-dP1ds5PsKqA.png


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)

y5zdIocBtFb3rkKA4o1oKUb36M2A5dGFUw.png

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)

6LKE_QGno8cB_RE73quvNy9gt4NnPp-XSw.png

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

IlMEeExZg-asylOu85mS83SJD72UdElASw.png

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!




Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

Related Articles

    Still can't find your solution?

    Visit our forums to search for answers, or post your own questions.

    Documentation
    Developer's Library
    Tutorials
    eBooks
    Product Hour
    Product Blog
    Workato Blog
    Product updates
    Customer Stories
    © Workato 2020   Privacy   Terms   +1 (844) 469-6752
    • Documentation
    • Workato Blog
    • Product Blog
    • Solutions
    • Forums
    • Tickets
    • Log in
    • Return to Workato