Webhooks are actions that allow the bot to exchange data with third-party systems on conversation time. They are often triggered by the end user response to a certain module.
In the BotXO Platform, you can create webhooks by using our Webhook Builder.
In the Webhook Builder, you're given the choice of using a Webhook Template to create a webhook or creating one from scratch. The Webhook Templates have a lot of pre-filled values to simplify the process, so we advise using them if you're not conversant with webhook configuration.
The technical details on how to create webhooks are explained more closely in the following articles:
Creating a webhook from scratch for Companies
Creating a webhook from scratch for Agencies
Creating a webhook template (WHT) for Agencies
An important part of the configuration of a webhook is how the response has to be parsed and stored in different variables. Some webhooks are very straight-forward and require no request body to be sent, but some are more complex and thus require some parsing of the response of the webhook. For example, if a WH response has the following content:
{
"ticket": {
"url": "https://aaaa.com/api/v2/tickets/388.json",
"id": 388,
"priority": "low",
"status": "open",
"external_id": null
}
}
A potential Custom Variable that could be extracted in this example is "ticket_status", then the Custom Variable fields when defining the variable should be:
Custom Variable Name: ticket_status
WH creator decides it. It must be easy to pick when editing the bot in the canvas
Response Mapper: {{ticket.status}}
Uses Jinja2 notation for parsing logic.
How to use webhooks in the canvas
There are three options when it comes to selecting a webhook for use in a bot.
- Selecting and configuring one of the many Webhook Templates offered by BotXO in the Webhook Builder
- Creating your own webhook from scratch for Agencies & Companies
We recommend that you take advantage of the many ready-to-use Webhook Templates that BotXO has published in the Webhook Builder.
As mentioned before, webhooks may be used in Module Connections and in Global Connections. They can be added as simple actions (clicking on "Add Webhook") or with conditions as part of a Connection. Those webhooks will then be triggered when that certain condition is met.
Please see the Conditional Webhook example below:
Comments
0 comments
Please sign in to leave a comment.