Skip to main content

Webim (Custom Channel API) as a customer engagement platform

Webim is an online consulting platform that supports multiple channels for communication, such as online chats, messengers, social media, chatbots, or mobile applications. The platform also integrates with CRM and HelpDesk systems.

To use Webim as your customer engagement platform:

  1. Create a channel in Webim.
  2. Create a customer engagement platform in JAICP.
  3. Connect it to an inbound channel.
  4. Configure dialog transfer to an agent or an agent group in the script

Create a channel in Webim

  1. Sign in to your Webim dashboard as an account administrator.

  2. Go to the Settings → General → Communication channels page.

  3. In the Custom section, click Add.

  4. Fill out the following fields:

    • Channel title — specify a name that will be displayed in the agent interface.

    • Your secret key — enter a secret key that will be used by the Webim platform to send messages.

    • Your server callback URL — specify the server URL where new message events will be sent. Use the following format:

      https://{host_name}/chatapi/webhook/webim/{channel_ID} — callback URL example.

    • Department choice — configure the settings for transferring the dialog to an agent department:

      • It isn’t necessary — specifying the department is not required when switching to an agent. In the dropdown list below, select the default department. You can also select No department: in this case, the default behavior will be to transfer dialogs to the general queue.

      • It is obligatory — the department should always be specified. In the dropdown list below, select the departments to which dialog transferring is allowed.

        If you select It is obligatory but don’t configure any allowed departments, the bot will not be able to transfer dialogs to any department at all.
  5. Copy the values from the Webim secret key and Channel ID. You will need them when creating a customer engagement platform in JAICP.

    • Webim secret key is used to identify requests to the Webim platform.
    • Channel ID is used to identify the channel used to send a message.
  6. Click Save.

Create a customer engagement platform

  1. Sign in to JAICP and go to your project.
  2. Go to Channels
  3. In the Customer engagement platforms section, click Connect channel.
  4. Select Webim (Custom Channel API).
  5. Fill out the following fields:
    • Name — specify the channel name.
    • Channel ID — paste the value from Channel ID.
    • Incoming secret — paste the key from Your secret key.
    • Outgoing secret — paste the key from Webim secret key.
    • Webim Account Name — specify the account name. You can copy the value from the address bar with your account subdomain: {your_account_name}

Connect an inbound channel

  1. Select an already connected inbound channel from the list to which you want to connect the customer engagement platform or connect a new one.
  2. Switch to the channel editing window.
  3. Select Webim in the Agent field and click Save.

Script details

To transfer dialogs to an agent, use the switch reply type in the script. Webim also supports transferring dialogs to an agent group assigned to a specific department.

Transfer to an agent

state: TransferToAgent
intent!: /agent
a: Just a moment, please… I’m transferring you to an agent.
$response.replies = $response.replies || [];
"type": "switch",
"firstMessage": $jsapi.chatHistory(),
"closeChatPhrases": ["/closeLiveChat", "Close chat"]

Transfer to an agent group

To transfer dialogs to an agent group:

  1. In Webim, go to Team → Staff and assign the department selected in Department choice to the necessary agents.
  2. Go to Team → Departments → Edit department and copy Symbolic department identifier.
  3. In the JAICP script, paste the department identifier to the destination parameter in switch.

The script result depends on the Department choice setting for the Webim channel.

Department choicedestination valueResult
It isn’t necessaryA valid department identifierTransfer to the department passed in destination
It isn’t necessary• An invalid department identifier
• The identifier is not specified
Transfer to the default department configured in the channel settings
It is obligatoryThe identifier of an allowed departmentTransfer to the department passed in destination
It is obligatory• The identifier of a disallowed department
• An invalid department identifier
• The identifier is not specified
No transfer
state: TransferToAgent
intent!: /agent
a: Just a moment, please… I’m transferring you to an agent.
$response.replies = $response.replies || [];
"type": "switch",
"destination": "main", // Symbolic department identifier in Webim.
"firstMessage": $jsapi.chatHistory(),
"closeChatPhrases": ["/closeLiveChat", "Close chat"]