- If you want to jump straight into some template code, go to our Integrations-Guides repository on github and pay close attention to the directories under
How to create your own Webhook
You can define one webhook URL for a brain, and then call the webhook from one or more dialog nodes.
To create your own webhook visit your brain and under the "Webhooks" tab click on "Create Webhook".
You will then be presented with a menu to create your webhook by providing:
- Verification token
Your webhook details are saved automatically once you click on "Create".
Testing your webhook
You can test your webhook by clicking on the
Send test request button.
On the right side you will receive:
- The status code
- The execution time
- The response
- Any error that occured
Updating context variables
Upon receiving your webhooks response, you can click
Update Context Variables in order to use the values returned by the webhook in the Brain while setting context variables from auto-complete functionality.
advanced test allows you to edit the payload of the request.
Testing with curl
We provide a Github repository Integrations-Guides that includes ready-made webhooks that you can use in your brains and that might also function as the templates for your own custom implementations.
Random number generator
This is a simple function that returns a random number based on the values of the query parameters. It can be used for simple examples such as AB testing etc. You can make an example call to the webhook using curl:
Get recent purchases
This function is more involved and returns a carousel of recent purchases for the user. It takes into consideration a time-cursor so that it can keep loading older cards in the carousel message.