How to use Comm100 Voice Bot Webhook
  • 08 Feb 2023
  • 2 Minutes to read
  • Dark
    Light

How to use Comm100 Voice Bot Webhook

  • Dark
    Light

Article summary

Comm100’s Voice Bot allows your customers to interact with a Voice Bot to receive information about products or services quickly and efficiently.

However, you may need to extend the capabilities of our Voice Bot by connecting it to your own database for more personalized and dedicated service.

Now, with the latest update, our Voice Bot can send data to your own web application using a “Webhook”. A Webhook is a custom web callback using HTTP POST query used to provide real-time information.

To set up these new personalized questions, you can supply Voice Bot with a URL of the web application to receive the Webhook data and return the relevant information to our Voice Bot service.

Step by Step Instructions

  1. Log in to your Comm100 account.

  2. From the left navigation menu, go to Bot > Voice Bot.

  3. Select a Voice Bot .

  4. Click New Intent or edit an existing Intent.
    Here, we choose to edit an existing Intent.
    image.png
    The Edit Intent page appears.

  5. Drag the Trigger a webhook action card to the flow builder area.
    image.png

Webhook Settings

You can click the Show all settings link on the Trigger a webhook card to further customize the webhook settings. The Webhook drawer appears where you can do the following:

  1. Add webhook URL.
  2. Add webhook header.
  3. Add Additional Post Body JSON.
  4. Add variable to save the webhook response.
  5. Input response code to action.
  6. Click OK.
    image.png

Data Sent to Your Web Application

Through the designated URL, your web application will receive the variables and their values from the chat sessions. The data that will be passed to your web application will include the “Fields” in the Pre-chat Window, Custom Variables, Variable of Visitors, Last Message from Visitors, and Matched Intents.

Your web application will then process the received data, generate and send us the result.
Your Additional Post Body JSON will append to post object.
image.png

Below is an example of the data in JSON format that will be sent to your server with your Additional Post Body :

  {
	"event": "questionAsked",
	"question": "Continue",
    "originalQuestion": "Continue",
    "isTranslated": false,
	"chatId": "f16dde4f-ec6a-4102-badb-09ed7bb5725e",
	"voicebotId": "cdf2da6b-2cc4-4c1d-a3c3-83d5dc8fc7f2",
	"visitorInfo": {
		"callerId": "", -- phone number
		"name": "",
		"state": "",
		"country":"",
		"city": ""
	},
	"variables": {
		"{!Variable.Name}": "Cici."
	},
    "intentId": "cb088eb3-7583-4b46-a09a-b098fc380b53",
	"intentName": "LostCard Form",
	"previousIntentId": "50d5d3d8-4a2c-4f9e-af63-f0574822dfe2",
	"previousIntentName": "Lost/Stolen Card",
    "key1": "Value1", --from your additional Post Body JSON
    "key2": "Value2", --from your additional Post Body JSON
}

Save Your Response to Variable

You can save the response to Variable, and the Variable can be used after the webhook called.
For example
Your response is

{	
    "code": 1, 
    "accountId": "xxx-xx"
}

You can save the "accountId" to Variable "sap_accountId"
image.png

If your response structure is complex ,For example your response is

{
    "result": 
     {	
        "code": 1, 
        "account": {
            "id": "xxxx-xx"
        }
    }
}

You can use "result.account.id" to get account id value, and save it to Variable like this:
image.png


Was this article helpful?