DingTalk Bridge (钉钉) #

Meldry's in-house bridge for DingTalk — the Alibaba-owned enterprise communication platform heavily used across China. Because DingTalk's protocol is proprietary and closed-source, this bridge is webhook-based rather than full session-emulation. Expect fewer features than the Telegram or Slack bridges, but reliable message delivery in both directions.

Prerequisites #

  • Meldry plan: Business
  • A DingTalk workspace where you have admin permission to create a "custom bot" (自定义机器人) and an app (应用)
  • DingTalk app credentials: AppKey, AppSecret, AgentID — all obtainable from the DingTalk Open Platform

Enable the bridge #

  1. Dashboard → Server → Bridges → DingTalk → Enable.
  2. The bridge container boots. The bot appears at @dingtalkbot:<your-name>.meldry.com.
  3. The dashboard shows a webhook URL — something like https://<your-name>.meldry.com/bridges/dingtalk/webhook. Copy it.

Configure DingTalk #

Step 1 — Create a DingTalk app #

  1. Visit open-dev.dingtalk.com and sign in.
  2. 应用开发 → 企业内部应用 → 创建应用.
  3. Fill in the app name, icon and description. Capability: choose 机器人 (Bot).
  4. Save. The platform returns your AppKey and AppSecret.

Step 2 — Add Matrix bridge credentials #

  1. DM @dingtalkbot:<your-name>.meldry.com:
    login <AppKey> <AppSecret> <AgentID>
    
  2. The bot validates with DingTalk Open API and confirms Logged in: <your-workspace-name>.

Step 3 — Point DingTalk at the bridge webhook #

  1. Back in the DingTalk developer console, under Event subscription (事件订阅), paste the webhook URL from your Meldry dashboard.
  2. Subscribe to: chat_message, chat_add_member, chat_remove_member, user_add_org.
  3. Save. DingTalk validates the endpoint — a green checkmark appears.

What gets bridged #

  • Group chats (群聊) → Matrix rooms.
  • 1:1 DMs → Matrix DM rooms.
  • Text, markdown cards, @ mentions → bidirectional.
  • Images and files → bidirectional, re-uploaded through Meldry media store.
  • Rich cards (卡片消息) → rendered as Matrix markdown.
  • Voice messages → ONE-WAY from DingTalk to Matrix only (DingTalk's inbound message API doesn't accept voice binaries from third-party apps).
  • Video calls → NOT bridged (DingTalk uses its proprietary RTC).
  • Attendance, approvals, schedule cards → displayed as read-only card messages in Matrix.

Commands reference #

CommandWhat it does
login <AppKey> <AppSecret> <AgentID>Link your DingTalk app
logoutUnlink the current workspace
statusCheck bridge health + last event received
groupsList bridged groups
bridge <matrix-room> <dingtalk-chat-id>Manually bridge one chat
helpFull command list

Bridging a specific chat #

DingTalk doesn't return a "chat list" API for bots — each chat must be bridged when the bot is first added. To bridge a new group:

  1. In DingTalk, add the custom bot (the one you created in step 1) to the target group.
  2. The bot posts a one-time confirmation message. Copy the chat ID from that message.
  3. In Matrix, run bridge !matrix-room-id dingtalk-chat-id in the bridge DM.

Limitations #

  • Webhook-based delivery means the bridge only receives messages that DingTalk's event subscription forwards. Some advanced message types (custom card schemas) may not be supported.
  • No message editing or deletion — DingTalk's open API doesn't support either on inbound events.
  • Reaction emoji are not supported (DingTalk has no reaction feature).
  • History backfill is limited to 7 days because the event subscription starts from "now" forward.
  • Messages from Matrix to DingTalk are posted by the custom bot you created — they appear to DingTalk users as "from [BotName]" with a [@Alice via Matrix] prefix.

Troubleshooting #

login returns Invalid AppKey/AppSecret — copy-paste carefully; DingTalk is case-sensitive.

Webhook shows as "unreachable" in DingTalk console — your Meldry workspace must be publicly reachable. Check that https://<your-name>.meldry.com/bridges/dingtalk/webhook returns a 200 when curled from outside.

No messages received — verify the event subscription is actually enabled and points at the current webhook. DingTalk sometimes silently pauses subscriptions after extended downtime.

Bot can't post to Matrix — the bridge bot needs invite permission in the target room. Invite @dingtalkbot:<your-name>.meldry.com to the room and grant it moderator-level PL (usually 50).

Privacy considerations #

  • DingTalk event payloads include sender info, chat metadata and message content. These transit HTTPS to Meldry's webhook endpoint and are stored in your workspace DB.
  • AppSecret is encrypted at rest in your workspace's private storage.
  • Unlinking the bridge deletes the credentials and stops the event subscription from being honored.

What's next #