Skip to main content
agentscope-extensions-channel-wecom connects your Agent to WeCom (企业微信 / WeChat Work) via the encrypted callback mechanism. A Spring @RestController receives message callbacks, decrypts them, and dispatches through the Gateway.

When to use

  • Your Agent needs to respond to WeCom bot messages in 1:1 chats or group chats.
  • Your application already runs Spring Boot.

Add the dependency

Prerequisites

  1. Create an Application in the WeCom Admin Console.
  2. Enable the Receive Messages API and configure the callback URL: https://your-host/api/channels/wecom/{channelId}/callback
  3. Note down the Corp ID, Agent ID, Secret, Token, and EncodingAESKey.

Quickstart

Configuration properties

Encryption

All WeCom callbacks are encrypted. The adapter handles decryption and signature verification automatically using WeComCrypto, which implements the WeCom callback encryption spec.

Message flow

Inbound: WeComCallbackController → URL verification (echostr) → decrypt → MsgId dedup → WeComInboundMapper (text messages) → bot-loop guard → Gateway. Outbound: WeComOutboundClient sends replies via /cgi-bin/message/send (DMs) or /cgi-bin/appchat/send (groups), authenticating with an access_token from WeComAccessTokenProvider.