Integration Modes
Choose the mode that best fits your needs:| Mode | Setup Difficulty | Features | Use Case |
|---|---|---|---|
| WeCom Bot | Easy | Group chat webhooks | Quick group bot setup |
| WeCom App | Medium | Custom app, private chat, proactive messaging | Full-featured enterprise integration |
| WeCom AI Bot | Medium | Official AI bot, streaming replies, group & private | Production-ready AI assistant |
All WeCom webhook-based integrations use the shared Gateway server on port 18790 (configurable via
gateway.host and gateway.port).Mode 1: WeCom Bot (Group Webhook)
Simplest setup for group chat integration.Prerequisites
- WeCom account with group admin access
- ~5 minutes for setup
Setup Instructions
Create a Group Bot
- Open WeCom desktop or mobile app
- Go to a group chat
- Tap Group Settings → Group Bots → Add Bot
- Name your bot (e.g., “PicoClaw Assistant”)
- Copy the Webhook URL (format:
https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx)
Get Token and AES Key
WeCom bots require verification:
- In WeCom Admin Console → App Management → Group Bots
- Find your bot and configure Receive Messages
- Copy the Token and EncodingAESKey
If you don’t need to receive messages (only send), you can skip this step. However, for interactive bots, you need both credentials.
Set Up Webhook URL in WeCom
- Go to WeCom Admin Console → Group Bot settings
- Set Receive Message URL to:
http://your-server:18790/webhook/wecom - Use HTTPS with reverse proxy for production
WeCom Bot Configuration
Mode 2: WeCom App (Custom Application)
Full-featured integration with custom app capabilities.Prerequisites
- WeCom admin account
- ~20 minutes for setup
Setup Instructions
Create a WeCom App
- Go to WeCom Admin Console
- Navigate to App Management → Create App
- Fill in:
- App name
- Logo
- Description
- Submit and wait for approval
Get App Credentials
After approval:
- Go to My Company page, copy CorpID
- Open your app, copy AgentId
- Copy Secret
Configure Receive Messages
In app settings:
- Click Receive Messages → Set API
- Set URL to:
http://your-server:18790/webhook/wecom-app - Generate Token
- Generate EncodingAESKey (click “Random Generate”)
- Click Save
Configure PicoClaw
Edit
~/.picoclaw/config.json:| Field | Description |
|---|---|
corp_id | Your organization’s CorpID |
corp_secret | App’s Secret |
agent_id | App’s AgentId (numeric) |
token | Token for message verification |
encoding_aes_key | 43-character AES key |
webhook_path | Webhook endpoint path |
WeCom App Configuration
Mode 3: WeCom AI Bot (Official AI Integration)
Official AI bot with streaming support and advanced features.Why AI Bot Mode?
- Streaming replies: Real-time response streaming
- No timeout issues: Uses streaming pull protocol
- Group & private chat: Supports both
- Official integration: Built for AI assistants
Prerequisites
- WeCom admin account
- AI Bot feature enabled (may require WeCom Pro plan)
- ~20 minutes for setup
Setup Instructions
Create an AI Bot
- Go to WeCom Admin Console → App Management → AI Bot
- Click Create AI Bot
- Fill in:
- Bot name
- Description
- Avatar
- Submit for approval
Configure Callback URL
After approval:
- In AI Bot settings, find Callback Configuration
- Set URL to:
http://your-server:18790/webhook/wecom-aibot - Copy Token
- Click Random Generate for EncodingAESKey
- Copy the 43-character key
- Click Save
WeCom AI Bot requires HTTPS for production. Use a reverse proxy or deploy on a server with SSL.
Configure PicoClaw
Edit
~/.picoclaw/config.json:| Field | Description |
|---|---|
token | Token from AI Bot configuration |
encoding_aes_key | 43-character AES key |
webhook_path | Webhook endpoint (default: /webhook/wecom-aibot) |
allow_from | Allowed user IDs (empty = allow all) |
welcome_message | First message users see (optional) |
WeCom AI Bot Configuration
Streaming Protocol
WeCom AI Bot Advantages:
- Uses streaming pull protocol (no reply timeout)
- Long tasks (>30 seconds) automatically switch to
response_urlpush delivery - Real-time response streaming for better UX
- Official AI bot support from WeCom
Access Control
All modes supportallow_from to restrict access:
Allow specific users:
- Check Gateway logs when users send messages
- Use WeCom Admin API to query user list
- Inspect webhook payload structure
Comparison Table
| Feature | WeCom Bot | WeCom App | WeCom AI Bot |
|---|---|---|---|
| Setup Difficulty | Easy | Medium | Medium |
| Group Chat | ✅ Yes | ❌ No | ✅ Yes |
| Private Chat | ❌ No | ✅ Yes | ✅ Yes |
| Proactive Messaging | ❌ No | ✅ Yes | ✅ Yes |
| Streaming Replies | ❌ No | ❌ No | ✅ Yes |
| Timeout Issues | ⚠️ Possible | ⚠️ Possible | ✅ No timeout |
| Webhook Required | ✅ Yes | ✅ Yes | ✅ Yes |
| Best For | Quick group bot | Full enterprise integration | Production AI assistant |
Troubleshooting
”Signature verification failed”
Cause: Token or EncodingAESKey mismatch Solution:- Verify
tokenandencoding_aes_keyin config match WeCom Admin Console - Check for extra spaces when copying
- Regenerate credentials if needed
- Restart gateway
”Invalid CorpID”
Cause: Wrong CorpID or missing Solution:- Go to WeCom Admin Console → My Company
- Copy CorpID exactly (starts with
ww) - Update config
- Restart gateway
Bot doesn’t respond
Check:- Gateway running:
picoclaw gateway - Webhook URL configured in WeCom
- HTTPS enabled (production requirement)
allow_frompermits the user- LLM configured:
picoclaw agent -m "test"
Webhook not receiving messages
Possible causes:- Webhook URL incorrect
- Gateway not accessible from internet
- Firewall blocking port 18790
- HTTPS certificate invalid
- Test webhook URL with
curl - Verify Gateway logs for incoming requests
- Use ngrok for testing:
ngrok http 18790 - Ensure
gateway.hostis0.0.0.0for external access
”App not found” errors
Cause: AgentId incorrect or app not approved Solution:- Verify AgentId in WeCom Admin Console
- Check app approval status
- Ensure AgentId is numeric (not string)
Privacy & Security
Data Privacy
WeCom integrations can access:- Messages sent to the bot
- User information (name, ID, department)
- Organizational structure
- Group information
- WeCom/Tencent privacy policies
- Chinese data protection regulations
- Your organization’s data policies
- Local data storage in PicoClaw workspace
- LLM provider data logging
Complete Example
Regional Considerations
China-Specific Notes:
- WeCom is designed for Chinese enterprise market
- Servers hosted in China for compliance
- Use Chinese LLM providers (Zhipu, Qwen, DeepSeek)
- Content filtering may apply
- Follow Chinese data protection laws
- International version (WeChat Work) has limited features
Next Steps
DingTalk Channel
Another enterprise platform in China
QQ Channel
Popular personal messaging in China
Telegram Channel
International alternative
Configuration
Advanced configuration options