15-day Pro trial · no credit cardStart free →

Channels

WeChatNew

Connect a WeChat Service Account to STINGIM and reply with customer service messages.

Connect a WeChat Service Account (服务号) so that messages WeChat users send to it arrive in your inbox, and your agents, bots and flows can reply in WeChat. Replies are sent with WeChat's customer service message API.

What you need

  • A verified Service Account (认证服务号) where you are an administrator. Subscription Accounts (订阅号) and unverified accounts cannot use the customer service message API.
  • Access to the Official Account admin at mp.weixin.qq.com.
  • The Integrations permission in your STINGIM project.

1. Collect the developer credentials

In the Official Account admin open 设置与开发 → 基本配置 (Settings & Development → Basic configuration):

  1. Copy the AppID (starts with wx).
  2. Generate or reset the AppSecret and copy it. WeChat shows it only once.
  3. Under IP白名单 (IP whitelist) add the outbound IP address shown in STINGIM on the WeChat channel page. Without it WeChat rejects every API call (error 40164) and replies cannot be sent.

2. Connect the account in STINGIM

  1. In the console open Settings → Channels → WeChat.
  2. Enter a display name, the AppID and the AppSecret.
  3. Optionally enter the account's original ID (starts with gh_). STINGIM fills in a random Token and EncodingAESKey. Copy both now (or enter your own: Token 3–32 letters or digits, EncodingAESKey 43 letters or digits). They are stored encrypted and never shown again.
  4. Click Save and continue. STINGIM checks the AppID and AppSecret with WeChat right away and warns you if the IP whitelist is still missing.
  5. Open Manage on the channel and copy the Server URL. It looks like https://api.stingim.com/v1/channel/wechat/<channel-id>.

3. Turn on the server configuration in WeChat

In 基本配置 → 服务器配置 (Server configuration) click 修改配置 (Modify) and enter:

FieldValue
URLThe Server URL from STINGIM
TokenThe same Token you saved in STINGIM
EncodingAESKeyThe same EncodingAESKey you saved in STINGIM
消息加解密方式 (encryption)安全模式 (safe mode, recommended). Plaintext and compatible mode also work.

Click 提交 (Submit). WeChat calls the Server URL to verify it. Then click 启用 (Enable). The channel in STINGIM shows when the URL was verified and when the last message arrived.

Enabling the server configuration turns off the auto-replies and custom menus edited in the WeChat admin. Use STINGIM flows and AI agents for automatic replies instead.

How messages are handled

From the customerIn the inbox
TextText
Image, voice, videoDownloaded from WeChat and stored with the conversation (voice keeps WeChat's speech-to-text when it is enabled)
LocationText with a map link
LinkTitle, description and URL
Follow, QR code scan, menu clickA contact is created; you can reply within 1 minute
UnfollowRecorded; you can no longer reply

WeChat no longer shares user nicknames or profile photos, so new contacts are named "WeChat User" followed by the last characters of their OpenID. A remark you set for the user in the WeChat admin is used when available.

Replies are sent as customer service messages:

  • Up to 5 replies within 48 hours of each customer message, and up to 3 replies within 1 minute of a follow, QR code scan or menu click. Outside these limits the reply is not sent, and the conversation shows why.
  • JPG, PNG and GIF images up to 10 MB and AMR/MP3 voice up to 2 MB are sent natively. Videos and other files are sent as a download link valid for 24 hours.
  • Long texts are split into up to three messages. Flow questions with buttons are sent as numbered options.

Troubleshooting

  • WeChat says the URL verification failed: the Token in WeChat must be exactly the Token saved in STINGIM; in safe mode the EncodingAESKey must match too. If you lost them, enter new values in STINGIM (Manage → Account settings) and in WeChat.
  • "IP not whitelisted" on the channel: add the IP shown in STINGIM to 基本配置 → IP白名单, then click Re-check.
  • No customer service message permission (48001): the account is a Subscription Account or is not verified.
  • Replies fail with "outside the 48-hour window": wait for the customer to write again.

Still stuck? Contact support.

Found a mistake? Email [email protected]