Rate this page:

How to connect a custom channel chatbot

Add custom bots to the selected chat. This feature allows you to receive messages from your customers directly to the agent’s chat from any service, including third-party ones. You can interact with APIs using webhooks.

  1. Log in to your Voximplant Kit account.
  2. Go to Settings > Channels.
  3. Select Custom channel.
  4. In the Channels window of the Settings sections, enter the channel name.
Channel details
  1. Define the callback URL.
  2. The system automatically generates Security Salt when you create the channel. Security Salt is a part of the signatures for events. The signature on our side is formed according to the algorithm:
  • the authorization header contains signature: MD5($ {Salt}: $ {token}: $ {EventId})

  • when creating a channel to the Callback URL, a test request contains signature: MD5($ {Salt}: $ {token})

  1. Select the API token from the drop-down list.
API token
Note

To generate the API token, go to the Integrations section, then select the API Tokens tab. Click Add API Token.

  1. Select the queue or function to forward and receive messages.
  2. Add skills if needed.
  3. Click Add a channel.

To get a token for sending events to the Kit, use the login method: POST https://kit-im-{{ACCOUNT_REGION}}.voximplant.com/api/v3/botService/login?domain={{domain}}&access_token={{access_token}}

Add channel_uuid {{channel_uuid}} to the body of this request. You can get channel_uuid in the settings of your channel in the channel UUID field. The link looks like this: https://kit-im-{{ACCOUNT_REGION}}.voximplant.com/{{CHANNEL_UUID}}.

By using this request, you receive two new tokens: access_token and refresh_token.

  • access_token is valid for 15 minutes.

  • refresh_token is valid for 24 hours.

The following example shows the data structure that Voximplant Kit expects from an external source:

`{
    "client_data": {
        "client_id": "107804195", // REQUIRED! Client ID in the external channel
        "client_phone": "", // Customer phone number
        "client_avatar": "", // Customer avatar link
        "client_display_name": "James Smith" // Сustomer name
        "client_email": "", // Customer Email 
        "client_language": "",
        "utm": {
            "source": "",
            "campaign": "",
            "content": "",
            "medium": "",
            "term": ""
        },
        "page": {
            "url": "",
            "title": ""
        },
        "location": {
            "latitude": 33.1212,
            "longitude": 33.1212,
            "country": "",
            "country_code": "",
            "region": "",
            "region_code": "",
            "city": "",
            "ip_address": ""
        },
        "device": {
            "type": "",
            "model": "",
            "user_agent": ""
        }
    },
    “event_id”: “123”,
    “event_type”: “send_message”
    “event_data”: {
        "message": {
            “message_id”: “123”,
            "text": "",
            "payload": [
                {
                    "type": "photo | audio | video | document",
                    "file_name": "",
                    "file_url": ""
                }
            ]
        }
    }
}`

Use the header Authorization: Bearer {{access_token}} in the request to send messages to the channel.

Use refresh_token to get a new access_token without specifying additional data: POST https://kit-im-{{ACCOUNT_REGION}}.voximplant.com/api/v3/botService/refreshToken. In the body, specify only the refresh_token:{{refresh_token}} that you received earlier. You receive two new tokens: access_token and refresh_token.