Manage channels
A channel is a messaging capability provided by DataBridge Agent. It allows you to ingest user messages from instant messaging (IM) platforms, such as DingTalk and Lark, into DataBridge Agent, and deliver AI-processed replies back to the corresponding platform to enable two-way interaction. This topic describes how to create, enable, disable, and delete channels, and how to configure DingTalk and Lark bots.
Overview
DataBridge Agent uses channels to connect with instant messaging (IM) platforms, enabling two-way communication between users and the AI agent. On the channel management page, you can create, enable, disable, or delete channels. You can also choose between open mode and pairing mode based on your business needs. Currently, DingTalk and Lark are the supported IM platforms.
Before you begin, make sure that you have created a DataBridge Agent instance and created and configured a bot on the corresponding IM platform.
Channel list
On the channel management page, you can view all the channels that you have created. The channel list displays the following information. You can search for a specific channel by its channel name or App ID.
|
Column |
Description |
|
Channel name |
The channel name. This is either the bot name you provide when you create the channel or a name the system automatically generates. |
|
Status |
The current status of the channel, which can be Enabled or Disabled. |
|
App ID |
The App ID of the bot on the associated IM platform. |
|
Pairing Mode |
The mode used by the channel. Supported modes include Open mode and Pairing mode. |
Create a channel
-
Log on to the AI-Native Database Service console. In the left-side navigation pane, click DataBridge Agent to open the management page.
-
In the left-side navigation pane, click Channel.
-
Select a target DataBridge Agent instance and click New Channel.
-
In the Create Channel panel, configure the following parameters:
Parameter
Description
Platform
Select the IM platform. DingTalk and Feishu are supported.
App ID
Enter the App ID of your bot on the IM platform. You can find this information in the developer console of the respective IM platform.
App Secret
Enter the App Secret of your bot on the IM platform. You can find this information in the developer console of the respective IM platform.
Bot Name
(Optional) Enter a name for the bot, which is used to identify the channel. If left blank, the system generates a name automatically.
Pairing Mode
Select the mode for the channel. Supported modes are Open mode and Pairing mode. For more information, see Pairing mode.
Note-
DingTalk only supports open mode.
-
Once a channel is created, its Pairing Mode cannot be changed. Choose the mode carefully based on your business needs.
-
-
Click Create.
Enable or disable a channel
You can control message delivery by enabling or disabling a channel. When disabled, the channel stops delivering messages to the corresponding IM platform. When re-enabled, message delivery resumes.
Enabling or disabling a channel triggers a restart of the connection. Perform this operation during off-peak hours.
-
On the DataBridge Agent management page, click Channel in the left-side navigation pane.
-
Click the status switch for the target channel to enable or disable it.
Pairing (pairing mode only)
To receive messages from a channel in pairing mode, complete the following steps.
-
In Lark, send a direct message to the bot associated with the channel.
-
The bot responds with an authorization error. From this error message, copy the 8-digit pairing code.
-
Return to the DataBridge Agent management page. On the Channel page, click the Pairing button for the target channel, enter the 8-digit pairing code, and wait for the pairing to complete.
Delete a channel
This action cannot be undone. Deleting a channel permanently removes its configuration from the DataBridge Agent instance, and the configuration cannot be recovered.
-
On the DataBridge Agent management page, click Channel in the left-side navigation pane.
-
Click the delete icon for the target channel and confirm the deletion.
Appendix
Pairing mode
Channels support the following two modes:
|
Mode |
Description |
Use cases |
|
Open |
Any user can send messages to the bot and receive replies without verification. |
Ideal for team-wide sharing when you do not need strict control over message recipients. |
|
Pairing |
A user must enter an 8-digit pairing code and be approved by an administrator to receive messages. Each channel can be paired with only a single user. |
Use this mode when you must strictly control who can receive messages. |
Create a bot on an IM platform
DingTalk bot
-
Create a DingTalk app and bot
-
Go to the DingTalk Open Platform and click Application Development in the top navigation bar.
-
In the left-side navigation pane of Application Development, click Internal-facing Apps > DingTalk Apps. In the upper-right corner, click Create App.
-
In the Create App panel, enter the app name, app description, and optionally an app icon. Click Save.
-
In the left-side navigation pane, click Application Capabilities > Add Application Capability. Find the Bot card and click Add.
-
On the bot configuration page, turn on the bot configuration switch. For the message receiving mode, select Stream mode, and then click Publish.
-
-
Add required permissions
In Development & Configuration > Permissions, request the following permissions:
-
qyapi_robot_sendmsg -
Card.Instance.Write -
Card.Streaming.Write
-
-
Publish the DingTalk app
-
In the left-side navigation pane, click App Release > Version Management & Release, and then click Create New Version.
-
Enter the app version and version description. Select the desired visibility scope for the app, and then click Save. In the pop-up dialog box, click Confirm and Publish.
-
-
(Optional) Enable streaming output
If you want the bot to stream its responses progressively, similar to a typing effect, go to Capabilities > Template Management on the DingTalk Open Platform and create a new AI-powered card template. Associate it with your DingTalk app.
-
Add and verify the bot
Go to the group settings page in a DingTalk group and click the bot card area. On the bot management page, click Add Bot. Search for and select the target bot, click Add, and then click Done. In the group chat, @mention the bot to interact with it.
Lark bot
-
Create a Lark app
-
Log on to the Lark Open Platform and click Developer Console in the upper-right corner. Then, click Create Custom App. Enter the App Name, App Description, and an App Icon, and then click Create.
-
Go to the app management console, find the Bot capability, and click Add.
-
In the navigation pane on the left, click Permissions. On the permissions page, click Bulk Import/Export Permissions. Copy the following JSON configuration into the Import tab, click Confirm and Add Permissions, and then click Request Access.
{ "scopes": { "tenant": [ "aily:file:read", "aily:file:write", "application:application.app_message_stats.overview:readonly", "application:application:self_manage", "application:bot.menu:write", "cardkit:card:read", "cardkit:card:write", "contact:user.employee_id:readonly", "corehr:file:download", "event:ip_list", "im:chat.access_event.bot_p2p_chat:read", "im:chat.members:bot_access", "im:message", "im:message.group_at_msg:readonly", "im:message.p2p_msg:readonly", "im:message:readonly", "im:message:send_as_bot", "im:resource" ], "user": ["aily:file:read", "aily:file:write", "im:chat.access_event.bot_p2p_chat:read"] } } -
Go to the Credentials & Basic Info page and copy the App ID and App Secret. You will need these credentials when you create a channel.
-
-
Configure event callbacks
-
In the navigation pane on the left, click Event Subscriptions. On the Event Configuration tab, for Subscription Type, select persistent connection and click Save.
-
On the Event Configuration tab, under Subscribed Events, add and confirm the Receive Message (
im.message.receive_v1) event. -
On the Callback Configuration tab, for Subscription Type, select persistent connection to receive callbacks, and then click Save.
-
-
Publish the Lark app
After you complete the configuration, you must publish the app for the changes to take effect. In the navigation pane on the left, click Version Management & Release. In the upper-right corner, click Create New Version. Enter the version number and update details, then click Save at the bottom of the page and confirm the publication.
FAQ
-
Q1: Can I change the pairing mode after a channel is created?
No. The pairing mode is set when you create a channel and cannot be changed later. If you need to change the mode, you must delete the current channel and create a new one.
-
Q2: What is the difference between disabling and deleting a channel?
Disabling a channel retains its configuration, allowing you to re-enable it at any time. Deleting a channel permanently removes its configuration, which cannot be recovered.
-
Q3: Can one channel be paired with multiple users?
No. A channel in pairing mode can be paired with only a single user. If multiple users need to receive data, create multiple channels or use open mode.
-
Q4: Why does DingTalk not support pairing mode?
Due to limitations in the DingTalk Open Platform API, only open mode is currently supported for DingTalk. Lark supports both open mode and pairing mode.