Capability Overview
Current@xpert-ai/plugin-dingtalk capabilities:
- Receive DingTalk events via HTTP callback
- Handle private chat messages
- Handle group messages when users mention the bot (
@bot) - Send text/Markdown/card notifications via middleware
- Update sent messages via middleware
- Recall OTO (human-bot) messages via middleware
- HTTP callback only (no Stream mode)
- In groups, only
@botmessages are processed - Recall currently applies to OTO messages only
- Group list APIs are not stable across tenants; do not rely on automatic group discovery
Prerequisites
Before setup, prepare:- A DingTalk enterprise account with app management permission
- An internal enterprise app with robot capability enabled
- A public Xpert service URL
- Callback security values (
callbackToken,callbackAesKey)
Required Permissions
To read users (for user selector ordingtalk_list_users), you must grant:
qyapi_get_department_member(department member read permission)
60011).
Create DingTalk Integration in Xpert
Go to Settings -> System Integrations and create a provider of type DingTalk.Required fields
| Field | Description |
|---|---|
Client ID (AppKey) | DingTalk AppKey (same as Client ID) |
Client Secret | DingTalk app secret |
Enable HTTP Callback | Must be enabled in current version |
Callback Token | Signature verification token |
Callback AES Key | Used to decrypt callback payload |
Recommended fields
| Field | Description |
|---|---|
Robot Code | Needed for proactive send/update/recall operations |
Xpert | Fallback target when trigger binding is not hit |
Preferred Language | zh-Hans or en |
Client ID and DingTalk AppKey are the same value.
:::
Configure DingTalk Callback
After saving integration, you can get callback info from system integration test:- Use this public callback URL in event/callback settings.
- Keep DingTalk token/aes_key consistent with Xpert integration config.
- Use HTTP push mode.
Build an Auto-Reply Bot (MyCoder Scenario)
- Create and validate a DingTalk integration in Xpert.
- Add DingTalk Trigger to target expert workflow and select that integration.
- Publish the expert.
- Add the application bot to target group.
- Send
@botmessage in the group for verification.
- Existing conversation binding
- DingTalk trigger binding (
integrationId -> xpertId) - Integration-level fallback
xpertId
DingTalk Notify Middleware
Common tools:dingtalk_send_text_notificationdingtalk_send_rich_notificationdingtalk_update_messagedingtalk_recall_messagedingtalk_list_users
dingtalk_send_rich_notification supports:
markdowninteractivetemplate
Recipient Configuration
Middleware resolves target byrecipient_type + recipient_id.
Common recipient_type values:
user_idopen_idchat_id
- For user notifications, prefer stable user identifiers (
open_idor mappeduser_id). - For group notifications, use
chat_id(openConversationId). recipient_idcan use runtime variable (for example{{state.dingtalkRecipientId}}).