Connecting a WeChat Channel
WeChat is the leading messaging app in China. Contacts follow your WeChat Official Account to message it, and can send photos, videos and voice messages. Your account can reply for up to 48 hours after a contact's last message.
Before you start
You'll need a WeChat Official Account with developer access. Its AppID and AppSecret are on the WeChat Developer Platform: scan the QR code to log in, then go to My Business > Official Account. WeChat doesn't keep your AppSecret, so if you've lost it you'll need to reset it there.
WeChat's guide to calling its API explains the AppSecret and IP whitelist in more detail. It's only in Chinese, so you may want to use a translation tool.
Keep your AppSecret private, as anyone who has it can act as your account.
Adding the channel
Go to Settings > Channels and click New Channel. WeChat is under Social & Chat, or you can type its name in the search box.
Enter your AppID and AppSecret and click Add Channel.
Finishing setup
Once the channel is added, its configuration page shows what to add to your Official Account on the WeChat Developer Platform, so that messages reach your workspace:
- In its message push settings, enter the webhook URL as your server's URL and the token as its token.
- Add the IP addresses shown to its API IP whitelist. WeChat only lets whitelisted servers use your AppSecret, so the channel can't send messages until they're added.
If an IP address isn't whitelisted, WeChat may instead ask your account's administrator to approve it. If they reject it, that address can't be used for an hour, so it's best to add the addresses to the whitelist up front.
You can come back to these at any time from the channel's page.
Considerations
Each message a contact sends lets your account send them up to 5 messages over the next 48 hours. When a contact follows your account, scans one of your QR codes or taps certain menu items, you can send them up to 3 messages within a minute. WeChat's guide to customer service messages explains these limits.
Messages to contacts are sent as text, with any attachments included as links.
To learn more about channels in general, see Introduction to Channels.