3.3 KiB
3.3 KiB
WeChat Official Account Integration
Connect your Botpress chatbot to WeChat Official Accounts and engage with your Chinese audience in real-time.
Prerequisites
Before you begin, you need:
- WeChat Official Account (Service Account or Subscription Account)
- Create one at: https://mp.weixin.qq.com/
- App ID and App Secret from your WeChat Official Account settings
- Server Configuration enabled in WeChat Admin Panel
Configuration
1. Get Your WeChat Credentials
In your WeChat Official Account admin panel:
- Go to Settings & Development > Basic Configuration
- Copy your AppID and AppSecret
- Generate a Token (any random string, you'll use this in both WeChat and Botpress)
2. Install the Integration in Botpress
- Install this integration in your Botpress workspace
- Configure with your credentials:
- WeChat Token: The token you generated (used for signature verification)
- App ID: Your WeChat Official Account AppID
- App Secret: Your WeChat Official Account AppSecret
3. Configure WeChat Webhook
In your WeChat Official Account admin panel:
- Go to Settings & Development > Basic Configuration
- Click Enable Server Configuration
- Set the URL to https://wechat.botpress.tech/{your Botpress webhook ID}, where the webhook ID is the string provided after installing the integration.
- Set the Token to the same token you used in Botpress configuration
- Click Submit - WeChat will verify your server
Supported Features
Receiving Messages
Your bot can receive the following message types from WeChat users:
- Text messages - Plain text messages
- Image messages - Photos sent by users (PicUrl provided)
- Video messages - Video content
- Link messages - Shared links with title, description, and URL
Sending Messages
Your bot can send the following message types to WeChat users:
- Text messages - Up to 4,096 characters
- Image messages - Images (automatically uploaded to WeChat)
Limitations
WeChat Platform Limitations
- Official Account Required: Personal WeChat accounts cannot be used
- Customer Service API Window: Can only send messages to users who have messaged you within the last 48 hours
- Message Length: Text messages limited to 4,096 characters
- No Proactive Messaging: Cannot initiate conversations; users must message first
Troubleshooting
Webhook Verification Fails
- Ensure your Token matches exactly in both Botpress and WeChat
- Check that your webhook URL is publicly accessible
- Verify the URL ends with your integration webhook path
Messages Not Appearing in Botpress
- Check your WeChat Admin Panel logs for delivery errors
- Verify your App ID and App Secret are correct
- Ensure Server Configuration is enabled in WeChat
Bot Not Responding
- Check Botpress logs for errors
- Verify the user messaged you within the last 48 hours
- Ensure your bot flow is properly configured