Table of Contents

Advance chatbot builder: Webhook

Who can use Webhook in Chatbot Builder?

Advanced Chatbot Builder are available in the Pro & Business Plan only. Read more about our plans

A Professional plan is required to use and deploy Webhooks in Chatbots.

With a standard account, you would still be able to build chatbots with webhooks and save them successfully. However, using them as Keyword Action or Default Action would require upgrading to a Pro plan.

What is a Webhook in Chatbot Builder

Webhooks: Webhooks are automated HTTP callback functions you can use to perform a GET or POST API request.

Usage: Simply drag and drop the webhook icon or when you extend the chatbot, select the webhook feature.

Features

  1. URL & Method

Choose a Request method (GET/POST) and enter your URL endpoint of the external API.

You can make your URL dynamic by inserting variables into the path using the variables button.

Example: URL ⟶ https://webhook-wa-testing.clare.ai/123456789?name={{name}}

  1. Customize Headers

Headers in HTTP webhook requests are used to specify the purpose of the webhook or its content type.

It is optional to use headers, and it is by default turned off.

Headers are set as key-value pairs. Example: key = Content-Type & value = application/json

  1. Customize the body

The body of the webhook request is added here. This is also optional and set as off by default.

The Body must always be in JSON format.
  1. Set your test variable

Manually setting your test variables here.

  1. Test the Request

You can test the API request by clicking on the 'Test the request' button.

  1. Save Responses as Variables

You can also save the response of a request into variables or custom attributes. If your API response is a JSON with key-value pair, you can store each of the values by passing the key name. For example, if you want to store"result": "success" from the above response:

Storing Response values that are Inside an Object:

If you want to store the response value that is inside an object, you need to use the objectkey.keyname format.

Example: if you want to store the QuoteId, you have to use Result.QuoteId in the "Entire response Body" above

{ 
"Result": {
"QuoteId": "xxxxx",
"QuoteNumber": "xxxxxx",
"PolicyNumber": null,
},
"MessageValidation": null,
"QuoteReferrals": null
}

Storing Responses that are Inside an Array of the Object:

If you want to store the response value that is inside an Array of an object, you need to use the $.[0].objectkey.keyname[0].value format

Example: if you want to store current_status, you have to use $.[0].tracking_data.shipment_track[0].current_status in the "Entire response Body" above

[
{
"tracking_data": {
"track_status":1,
"shipment_track" : [
{
"id":1278937320,
"current_status":"Delivered"
}
]
}
}
]

Response Routing

You can use response routing to split your chatbot according to response status codes.

How did we do?

What features are available in advance chatbot builder

Advance Chatbot builder: Update Attribute

Contact