How to create a Webhook on a Code Step?
If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.
- Getting Started
- Bot Building
- Conversation Design
- Developer Guides
- Agent Setup
- Analytics & Reporting
- Troubleshooting Guides
- Release Notes
Webhooks are created, so as to send real-time notifications as and when events occur on your bot like agent handover notification or chat completion notification. So, in order to get these real-time notifications, you need to have a Webhook.
One of the ways of creating a Webhook is, asking Haptik to create it for your bot. This Webhook will be created at the backend, and as a user, you won't have access to this Webhook. In case, you need to make any changes to this Webhook, you will have to contact our Haptik team so as to get the change incorporated in your bot. This process seems quite tedious, which is why there is another way of creating a Webhook, and this article would help you in creating one.
Since you have access to the Code Steps in your bot, you yourself can create a Webhook. The process to do this is explained below. The main advantage here is that you won't have any dependencies on Haptik, and you can handle this end-to-end on your own. You can always get in touch with our team if you need any assistance with this, just by dropping an email to firstname.lastname@example.org.
Steps to create a Webhook using Code Steps
In order to create a Webhook on a Code step, we need to first create two Code steps on the bot. One to signify Staging environment and the other for Production.
The naming convention for these code steps, to be followed is stag_webhook_usecase_name and prod_webhook_usecase_name.
When you are done creating these two Code Steps, you will have to draft an email to Support(email@example.com), in order to get the URL for both the Code Steps and use that in the webhook section of Platform Deployments.
Following is the email template for the same -
To Support <firstname.lastname@example.org>
We need a webhook on the Code Step for <bot_name> bot. We need a URL for the following Steps created on the bot.
Bot name: <bot_name>,
Code Step 1: Add the Name and URL
Code Step 2:
Please provide us with the URL for these steps so that it can be used in the webhook section.
When the Support team shares the URLs, you need to copy the Stag_webhook_usecase_name URL and paste it to the Staging Webhook section of Platform Deployments, and similarly copy the Prod_webhook_usecase_name URL, and paste it to the Production Webhook section of Platform Deployments.
Once you have followed all the above steps, you would have created a webhook by yourself. Congratulations!