Configure Webhooks for use in your chatbot

Webhooks (WH) allow the bot to exchange data with third-party systems. Each Webhook is an HTTP request that is fired on conversation time when you add it to a Connection. They're often triggered by the end user's response to a certain Module. 

In this article, we will explore:

Webhook configuration

In the Certainly Platform, you can create Webhooks by using our Webhook Builder, shown below. This can be accessed from the left side of the Navigation bar at the top of your canvas.

Screenshot_2021-06-01_152335.png

In the Webhook Builder, you're given the choice of either creating a Webhook from scratch or using a Webhook Template (WHT) from our Webhook Marketplace. 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.

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 straightforward 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. Must be easy to pick when editing the bot in the canvas.
Response Mapper:         {{ticket.status}}
                                       Uses Jinja2 notation for parsing logic.

The technical details on how to create Webhooks are explained more closely in the following articles:

How to use Webhooks in the canvas

There are two main options when it comes to selecting a Webhook for use in a bot:

  1. selecting and configuring one of the many Webhook Templates offered by Certainly in the Webhook Builder, or
  2. creating your own webhook from scratch (for Agencies & Companies).

We recommend that you take advantage of the many ready-to-use Webhook Templates that Certainly has published in the Webhook Builder. 

Webhooks may be used in Module Connections and in Global Connections. They can be added as:

  • simple actions (clicking on "Add Webhook" in the Connections tab), or
  • with conditions as part of a Connection (as shown in the image below). Those Webhooks will then be triggered when that certain condition is met.

Here you can see an example of a Conditional Webhook:

Screenshot_2021-06-01_154434.png