HTTP Webhook : Trigger breakdown
Understanding each part of the trigger
We will now dissect the HTTP REAL TIME trigger to provide a step-by-step guidelines for setting up your HTTP Webhooks action.
Each application's webhook may work different from one another. When in doubt, always refer back to your application's API documentation. In this case, we are going to attempt to create a webhook action for pulling REAL TIME events from Eventbrite.
Here is Eventbrite's API doucmentation : https://www.eventbrite.com/developer/v3/api_overview/webhooks/
Good API documentations should mention the following key information. Here are some excerpts from Eventbrite :
1) The type of the webhook
2) An example Webhook Payload
3) How to configure your webhooks on the application itself
Once these information had been identified, we can now proceed to add these information into our webhook trigger
Webhook DestinationData sent via API from your application needs a destination address in order for webhooks to work. The address of your recipe can be found at the top of your trigger. It comes in the form of an URL :
When prompted by your application, this will be the URL to use when creating a webhook interaction. In the example of Eventbrite, This URL will be used here :
Naming your Webhooks
For better usability and understanding of your Webhook trigger, you may name it based on the actions and objects involved. For example, This webhook could be named as New Event Received in Eventbrite
The result will appear in our Workato recipe as this :
Identify the Webhook Method
It is important that you get this correctly. Webhooks in applications all work differently, using different HTTP Methods. Different HTTP Methods translates to different Webhook behaviour. The available HTTP Methods that Workato supports are :
- GET Request
- PUT/POST with JSON Payload
- PUT/POST with XML Payload
- PUT/POST with FORM encoded payload
Specifying a Sample Payload
If the HTTP Method involves one of the PUT/POST HTTP Method, chances are you will be receiving a payload from the application service. In order for Workato to parse those data, a sample response document needs to be provided :
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!
For an example webhook payload, check out this page here.