WeChat is a Chinese multi-purpose messaging application, with social media and mobile payment features developed by Tencent.
First released in 2011, WeChat is currently gaining ground on well known competitors WhatsApp, Viber and LINE with some of its unique features and integrated apps.
To build a chatbot in Wechat you need the WeChat app installed on your mobile and a ChatCompose account. You can register here.
This guide is intended to integrate a chatbot with the sandbox feature of Wechat.
Navigate to the wechat sandbot. The website will be in Chinese so you can use a built in browser translation plugin to read the details.
Log into the Sandbox by clicking the green button.
The page will show you a code to scan with your mobile wechat app. Scan the code to continue to the sandbox.
The sandbox will provide you with an appID and an appSecret. You will need these keys to link ChatCompose to your Wechat ChatBot.
It will also ask you to enter two URL paths, one to validate your url and another one as a callback url that will be called when a message is entered into the chatbot.
Login to ChatCompose and navigate to Install>Wechat.
In the Wechat Section you will have to enter the appID and the appSecret given to you in the Sandbox. Also enter a Token for your chatbot. In this example we called the token "TOKENSECRETO".
Save to continue.
Back in the sandbox navigate to the second section and enter your token ("TOKENSECRETO" in this case) and the url given to you from ChatCompose.
Save to continue. The sandbox will call the url to make sure both tokens match. It will notify you if succesful or not.
Now enter the callback url. It will be same url we used to validate the token. Save to continue.
Now your chatbot is configured for the sandbox. To start testing the chatbot scan the code the sandbox gives you, add it to your wechat app and send your first message.
After installing your chatbot and testing it you can register a Business account at weixin. After going through some business verification (and payment) the weixin platform will allow you to register and use chatbots for an official account.