Conversational AI Cloud uses webhooks to call to your back-end system when certain conditions are met. These webhooks are used, for example, to validate a transaction or determine which answer a question should receive.
You can add new and edit existing webhooks via the Configuration menu in Conversational AI Cloud:
To get your Webhook up and running, you need to meet the following requirements:
You need to have a public endpoint
You need to answer according to the data contract of the Webhook type you defined in the CMS
Building Webhooks requires that you adhere to the “data contract” that is defined. The data contract uses Inbound and Outbound calls to the engine and is defined in the documentation for each use case. We have provided some standard Webhooks on our public repository with examples on how to build them using Nodejs.
Add a New Webhook
Go to the Configuration Screen in Conversational AI Cloud CMS
Click on the new button on the top right of the screen
Provide a name and description for the webhook
Select the webhook type
Define the request timeout (in milliseconds) in which the webhook will respond (if the Webhook takes longer an error will occur)
Finally, define the development, staging, and production webhook URLs. This will allow you to answer different things depending on the environment you are in.
Note: Only one context variable webhook can be created which is used for all contexts.
Important note about migrating from dimension scripts to context variable webhooks:
Before you start building the webhooks, the publish for the project should be switched off. This is to prevent any contexts from breaking while the work is still in progress. Once all webhooks that are needed are in place, then the publish can be switched on again and the context variables will be managed via the webhooks.
Edit a Webhook
You can edit the Webhook in the Configuration Screen. Go to your Webhooks and click on the pencil icon next to the Webhook that you want to edit.
The only value that can't be changed while editing is the Webhook type.