Webhooks within your bots (New Web App)

Webhooks within your bots (New Web App)

Overview

Webhooks allow you to use real time information within your Webio bots.  This can be used to provide customers' up to date information within the conversation or to configure logic decisions within your bot based on information provided from your internal systems. 
Info

The process outlined below is typically used for inbound, campaign-initiated conversations where the customer UID is initially null. However, it can be requested through the listening step and will be stored against the conversation. This allows you to retrieve any data stored against that Customer UID from your internal system.

For outbound campaigns, your campaign file must include at least two fields: one for the phone number and another for the customer UID. When configuring the campaign, ensure that the field containing the customer UID is correctly mapped to "Custom ID."

Once this mapping is in place, any additional parameters associated with that Customer UID will be retrieved directly from your internal system—removing the need to include them in the campaign file.

Alternatively, the customer UID can be collected during the conversation using the same process outlined below.

Endpoints not integrated yet?  Integrate Endpoint.
You can add in real-time values within your message content or within a logical branch condition. 

Real Time Value In Message Content

To include real-time values in your bot message:

  1. Click into the step of your bot where you want to insert real-time data.
  2. Type your message in the Outgoing Message box.
  3. Insert real-time values using double angle brackets: <<fieldname>> at the desired position in your message.

Example (Inbound):

Suppose that, in response to the customer providing their customer UID, you want to send a message containing values stored against that UID, including the following:
  • Customer name
  • The outstanding balance 
  • The currency
  • Payment Link
  • Payment deadline

These values will be retrieved in real-time from your internal systems via the webhook endpoint configured in your Organisation.

First, confirm the field names used in your internal system. For this example, they are:



You can now construct your message like this

Thanks. Your outstanding balance is <<outstandingBalance>> <<currency>> to be paid at <<paymentlink>> by the <<paymentDate>> .This ensures the bot dynamically pulls and displays the correct values during the conversation.


When this message is triggered by the bot, a webhook request will be sent to the designated endpoint within our organization to retrieve the required values. The returned values will be populated into the message and sent before the bot proceeds to the next step.
If the webhook request fails, the bot will either follow the Failure Step route or display "null" for any values that could not be retrieved.
For inbound conversations where the customer ID is initially null, it can be captured via a listening step and stored in the customer ID field. This enables the bot to retrieve any data associated with that customer UID (case sensitive).


Warning
Please note that if a non-matching customer UID is provided, or if no customer UID is provided at all, the bot will encounter an error when trying to retrieve data stored against the provided customer UID.
 
To avoid this, you might want to build a logical check within your bot to redirect the customer to the relevant conversation path depending on the answer provided, and also add an extra layer of security to confirm that data is displayed to the correct customer. Check the example below.

Using real-time values to make logical decision

Once the customer UID is obtained via the Listening Step from the customer's response, all associated customer data can be retrieved through a webhook call. After collecting the UID, you can implement additional logical branching to guide the customer appropriately:

  • Redirect to a fallback path if the UID provided is incorrect.
  • Redirect to a fallback path if the UID is correct but the returned information (e.g., date of birth) is invalid or mismatched.
  • Proceed to the success path if both the UID and the returned information are verified as correct









    • Related Articles

    • Webio Webhook - What it does (New Web App)

      Overview Using Webio's webhook you can configure your endpoints within your Webio organisation to post or retrieve data. Identifying the request is from us To generate the JWT header you need the api key from your Webio organisation, your secret key ...
    • Listening Steps To Gather Data (New Web App)

      Overview The Listening Step waits for the customer's response before proceeding to the next step and also store the response in either Data Fields or Customer ID Fields Check how this works on the Classic Web App Listening Steps To Gather Data ...
    • How to configure a Webhook

      Overview Using the Webio webhook, you can configure endpoints within your Webio organization to post or retrieve data, so you can: Receive notifications (Post Request) from your organization to your internal system, whenever an event that you ...
    • Setup your Organization

      Overview To access the Organizations screen, from the navigation panel on the left-hand side, click on Settings, then Organizations; From here you can control your organization's settings and all your sub orgs. When you create a new organization or ...
    • Conversation Flow Builder & Step types

      Overview From Webio Bots screen, using our drag-and-drop interface, you can create conversation flows. Each "block" represents a piece of the conversation, such as a message, an action or waiting for an user input. When building a bot your can add ...