Skip to main content

๐Ÿ’ฌ WeCom Integration

๐Ÿ‘ค Who it's for: Companies using WeCom (Enterprise WeChat)
โฑ๏ธ Read time: ~5 minutes
๐Ÿ’ก In one line: Turn YingClaw into an intelligent employee inside WeCom โ€” always online, highly collaborative.

Connect YingClaw to WeCom (Enterprise WeChat) via WebSocket long-lived connection for real-time enterprise messaging.


Overviewโ€‹

YingClaw uses WeCom's Bot WebSocket protocol to establish a persistent connection, supporting text, image, and voice message handling with heartbeat keep-alive and automatic reconnection.

ScenarioDescription
๐Ÿ’ผ Enterprise AssistantEmployees chat directly with AI in WeCom
๐Ÿ“‹ Business QueriesQuery CRM, orders, data reports
๐Ÿ“ข NotificationsSystem alerts and scheduled reports pushed to WeCom

Setupโ€‹

1. Get WeCom Bot Credentialsโ€‹

Create a Bot application in the WeCom admin console to get:

  • Bot ID: The Bot's unique identifier
  • Secret: The Bot's secret key

2. Configure in YingClawโ€‹

Log into the YingClaw Web Console, go to "Channels", enable WeCom:

ParameterDescription
bot_idWeCom Bot ID
secretWeCom Bot Secret
websocket_urlWebSocket endpoint, default wss://openws.work.weixin.qq.com
allowed_usersEmployee allowlist, * means all employees

3. Start the Channelโ€‹

After saving, YingClaw automatically establishes the WebSocket connection. The system will:

  • Send periodic heartbeat pings to maintain the connection
  • Auto-reconnect on disconnection
  • Receive and reply to messages in real time

Message Interactionโ€‹

Private Chatโ€‹

Employees send messages directly to the WeCom Bot, supporting:

  • ๐Ÿ’ฌ Intelligent Q&A and business consulting
  • ๐Ÿ“Š Sales data queries (CRM integration)
  • ๐Ÿ“ Document generation and editing
  • โฐ Schedule and task management

Group Chatโ€‹

After adding the Bot to a WeCom group, it can receive messages and push notifications and reports.

Message Type Supportโ€‹

TypeSendReceive
Textโœ“โœ“
Imageโœ“โœ“
Voiceโœ—โœ“

User Allowlistโ€‹

channels:
wecom:
allowed_users:
- "ZhangSan" # Only specific employees
# - "*" # Allow all employees

Notesโ€‹

  • WebSocket connection requires network access to openws.work.weixin.qq.com
  • Voice messages can only be received, not sent
  • Heartbeat mechanism maintains the connection automatically
  • Use a dedicated WeCom app separate from other business applications

Next Stepsโ€‹