To set up WeChat as a channel, you need to register for a WeChat Official Account. You also need to enable webhook integration for the Bots platform to send and receive messages.
Please refer WeChat Official Accounts Registration Process for more information.
To add the weChat Messaging channel to a bot
For development purposes, you may also use the WeChat Sandbox environment to integrate the bot and test the bot functionality. This next section elaborates on setting up and using the sandbox account.
Step 1: Setup Sandbox Account
- Register and login to WeChat Sandbox environment from here for English and here for Chinese versions.
- Click ‘Log In’ button to continue to login.
- You would be required to install the WeChat mobile app to allow sign in using the QR presented on-screen.
- Scan the QR code and confirm Login to proceed.
- Post successful sign-in, you would be redirected to the Sandbox portal.
- The Sandbox portal provides information about your WeChat Sandbox App ID and App Secret.
- Make note of App ID and App Secret.
- You need to enter the WebHook URL and Token, you can obtain these values from the Channel Enablement page of the Bots Platform as explained below.
Step 2: Setup Webhook
From the Bots platform:
- In the Bots section of the Bot Builder, click the Bot that you want to add the weChat channel to.
- On the Channels tab, click the weChat icon. The weChat Channel page gets displayed.
- Navigate to the Configurations tab and enter the following details:
- App Id – App Id from the weChat Sandbox portal page
- App Password – App Secret from the weChat Sandbox portal page
- Make a note the following details
- Webhook URL, and
- Access Token
- Update the WeChat Sandbox portal page with the above URL and access token and Save the details
- Enable the weChat channel from the Bots platform.
Editing the Channel
To edit the channel, hover your mouse over the channel and click to modify. You can make necessary updates to your channel configurations and save them. You may also disable or delete the channel information by clicking the Settings icon.
Select one of the following commands to modify the channel:
- Disable/Enable – Click Disable to temporarily disable use of the Slack channel for your Bot. To enable the use of the Slack, click Enable.
- Delete – Click Delete, and then click OK in the Delete Confirmation dialog to permanently delete the Bot channel configuration.