DingTalk Setup
Connect your CCCC working group to DingTalk for enterprise collaboration.
Overview
DingTalk (钉钉) is ideal for:
- Chinese enterprises
- Alibaba ecosystem users
- Teams already using DingTalk
CCCC uses DingTalk Stream mode (persistent WebSocket connection) for inbound messages and DingTalk Open APIs for outbound messages. No public URL is required.
Prerequisites
- DingTalk enterprise account with admin access
- CCCC installed and running
Step 1: Create an Application
- Go to DingTalk Open Platform
- Log in with your enterprise admin account
- Click Application Development → Internal Development
- Click Create Application
- Fill in:
- Application Name (e.g., "CCCC Bot")
- Application Description
- Application Icon
- Click Confirm
Step 2: Configure Permissions
- Go to Permissions
- Apply for the following permissions:
| Permission | Purpose |
|---|---|
Robot.SingleChat.ReadWrite | Single chat robot management |
qyapi_robot_sendmsg | Robot proactive message sending |
qyapi_chat_read | Read group basic info |
qyapi_chat_manage | Manage group chats (create, update, send messages) |
- Click to enable each permission (no approval needed for internal apps)
Step 3: Enable Robot
- In Application Capabilities → Robot
- Enable the robot capability
- Configure robot settings:
- Robot name
- Robot avatar
Step 4: Publish the Application
- Go to Version Management
- Create a new version
- Configure visibility:
- All employees
- Specific departments
- Specific users
- Publish the version
Step 5: Configure & Start CCCC
- In your application, go to Credentials & Basic Info
- Copy AppKey and AppSecret
- (Optional) Copy RobotCode if shown in your Robot settings (CCCC can sometimes learn it after the first inbound message, but configuring it upfront is more reliable for attachments)
Option A: Via Web UI
- Open the CCCC Web UI at
http://127.0.0.1:8848/ - Go to Settings (gear icon in header)
- Navigate to the IM Bridge tab
- Select DingTalk as the platform
- Enter your credentials:
- App Key: Your DingTalk AppKey
- App Secret: Your DingTalk AppSecret
- Click Save Config — the bridge will start automatically and show Running status
Option B: Via CLI
First set environment variables:
export DINGTALK_APP_KEY="your_app_key"
export DINGTALK_APP_SECRET="your_app_secret"
export DINGTALK_ROBOT_CODE="your_robot_code" # optional but recommendedThen configure and start the bridge:
cccc im set dingtalk \
--app-key-env DINGTALK_APP_KEY \
--app-secret-env DINGTALK_APP_SECRET \
--robot-code-env DINGTALK_ROBOT_CODE
cccc im startVerify it's running:
cccc im statusBoth methods save to group.yaml:
im:
platform: dingtalk
dingtalk_app_key_env: DINGTALK_APP_KEY
dingtalk_app_secret_env: DINGTALK_APP_SECRET
dingtalk_robot_code_env: DINGTALK_ROBOT_CODEStep 6: Subscribe in DingTalk
- Find the robot in your DingTalk application
- Add it to a group chat or start a direct conversation
- Send
/subscribe - Confirm the subscription
Usage
Sending Messages to Agents
DingTalk supports two ways to send messages:
Direct message (implicit send) — just type your message:
请检查一下代码质量Explicit /send command — for specifying recipients:
/send @foreman Please check the code quality
/send @all Status update pleaseImplicit Send
DingTalk messages are always directed at the bot (via @mention in groups or direct chat), so plain text is automatically treated as /send to the foreman. You only need the explicit /send command when targeting specific agents.
Targeting Specific Agents
Use @mention syntax with the /send command:
/send @foreman Please assign today's development tasks
/send @reviewer Please review the latest commits
/send @all Status update pleaseReceiving Messages
After subscribing, you will automatically receive:
- Agent responses
- Status updates
- Error notifications
Use /verbose to toggle whether you see agent-to-agent messages.
Message Types
DingTalk supports various message types:
- Text: Plain text messages
- Markdown: Formatted text
- Link: URL cards
- ActionCard: Interactive cards with buttons
CCCC automatically selects the appropriate format.
File Sharing
Attach files to your message. DingTalk files are downloaded and stored in CCCC's blob storage, then forwarded to agents.
Commands Reference
| Command | Description |
|---|---|
/subscribe | Start receiving messages from CCCC |
/unsubscribe | Stop receiving messages |
/send <message> | Send to foreman (default) |
/send @<actor> <message> | Send to a specific agent |
/send @all <message> | Send to all agents |
/send @peers <message> | Send to non-foreman agents |
/status | Show group and agent status |
/pause | Pause message delivery |
/resume | Resume message delivery |
/verbose | Toggle verbose mode (see all agent messages) |
/help | Show available commands |
Troubleshooting
"Invalid appkey" Error
- Verify AppKey in DingTalk Open Platform
- Check environment variable is set correctly
- Ensure the application is published
"No permission" Error
- Check required permissions are granted
- Verify the app is visible to the user
- Ensure the app version is published
Robot not responding
- Check if the robot is added to the chat
- Verify the bridge is running:bash
cccc im status - Check logs:bash
cccc im logs -f
Connection drops
If the connection drops unexpectedly:
- Check network connectivity
- Restart the bridge:bash
cccc im stop cccc im start
Security Notes
- Keep your AppSecret confidential and rotate it periodically
- Use the minimal required permissions
- Review robot/app access regularly
- Audit message logs regularly
- Limit robot visibility to necessary employees