Webhook channel provides a generic integration framework to connect your virtual assistant with any external communication systems. Kore.ai XO Platform provides standard request and response APIs to send and receive messages in text format. The end user’s input through a voice, keypad, or any other means must be converted to plain text before it is sent to the Kore.ai XO Platform using the Request API.
You can enable multiple instances of the Webhook channel for your virtual assistant. When you enable the Webhook channel for the first time, the platform creates an instance of the Webhook channel. The Webhook Channel will continue to be available under the ‘Available Channels’ list and you can choose to create additional instances. Each of the Webhook channel instances is presented as an independent channel to define messages, prompts, filters etc., across the application.
Webhook Versions
The platform supports two versions of the Webhook channel i.e., V1.0 and V2.0.
Note: The V2.0 is the recommended version as it provides a scalable request and response format. Here are the key differences:
Feature | Webhook V1.0 | Webhook V2.0 |
Events | Not supported | Supports ‘on connect’ event |
Poll Mechanism | Not supported | Supported in Synchronous Mode |
File Upload in Chunks | Not supported | Supported |
Integration Mode
The platform supports Synchronous and Asynchronous modes of integrations for the Webhook channel. Here are the key differences:
- Synchronous Mode: The bot responses are directly delivered as response to the incoming requests. The bot will execute the flow, identify the response or responses to be delivered and provide them as the response to the incoming request. Some of the platform functionalities like Alert Tasks, Agent Transfer, Proactive Session Closure messages are not supported in the Synchronous mode. You may consider using the onAlert event through BotKit, learn more.
Note: Synchronous Webhook channel requests timeout after 15 secs. We recommend using Asynchronous Webhook Channel if you expect the requests to take beyond 15 seconds. - Asynchronous Mode: Asynchronous mode is useful if you would like to deliver the bot responses to a different URL other than the incoming request’s URL. You have to configure the POST_URL of your external system to enable the Async mode. The bot responses are asynchronously delivered to this POST_URL. Do note that Kore.ai XO Platform does not provide the service to host the POST URL. You need to host a custom service or use a third-party service for this.
Prerequisites
To enable the Webhook channel for your Kore.ai bot, you must:
- Associate App – To enable the Webhook channel for your Kore.ai bot, you must associate the channel with either an existing app in your Kore.ai account or create a new app.
- Select Integration Mode – Enable an integration mode that is supported by the channel based on your business requirement. You can copy the Webhook URL from the Configurations tab of the channel.
- Review Payload Formats – Review Payload formats to verify the integration.
To access the Bot Platform’s public APIs, the application making the API request requires authentication. Kore.ai uses the JWT (JSON Web Token) technology to handle the authentication. For a quick overview of the JWT token, refer to Introduction to JWT tokens.
Step 1: Associate an App
-
-
-
-
-
- In the XO Platform, select the assistant to which you want to add the channel.
- Go to Deploy > Channels > Webhook.
- Go to the Configurations tab of this page and associate this channel with an app.
- Enter a Name for the channel.
- You can select any of the existing Apps available in your Kore.ai account or create a new app.
- Enter a Name for the app and configure it, as follows:
- Select one of these scopes for the app:
- Allow anonymous users to chat with the assistant: enables anonymous users to interact with the assistant.
- Auto register new users on Kore.ai XO Platform: Select to control the auto-user registration in Kore.ai if the user assertion is unknown.
- In the JWT Signing Algorithms Used For Client App Authentication drop-down list, select one of the following security algorithms:
- RS256: Select to enable the Public Key field. The Public Key is used by the Kore.ai XO Platform to authenticate the client application.
- HS256: Select to generate a Secret Key and a Client ID. The Client ID is required for SDK initialization, and the Secret Key used by the Kore.ai XO Platform to authenticate the client application.
- Click Create. The app is created and Client ID and Client Secret are generated. Copy the Client ID and Client Secret details.
- If you want to use the JSON Web Encryption (JWE) standard, you can view the Public Key by clicking the link provided below the Client Secret field.
- The Webhook channel supports both synchronous and asynchronous modes. Depending on your business needs, you can enable one of these modes in the Configurations tab.
- Select Yes to Enable Channel.
- Save the configuration. The Webhook URL in this channel instance is created dynamically.
- Use the Webhook URL to establish integration with external communication systems. This URL is available only after enabling the channel.After completion of these steps, a success message appears on the screen, and a channel request is sent to your Bots Admin for approval.
-
-
-
-