Skip to content

WeChat

The following steps give you an overview of the steps necessary to create a bot for the WeChat messenger. Since the user interface of the WeChat platform is regularly subject to change, the following steps are not entitlement to completeness or accurateness. However, we update the documentation on a regular basis and look forward to your hints.

WeChat is a Chinese multi-purpose messaging, social media and mobile payment app developed by Tencent.

The bot account of the Business Bot Platform is a full WeChat client. It uses an internal library to communicate with the WeChat server. This implementation takes care of the authentication process, message reception, and message reply. This allows you to concentrate on the business logic of your bot application.

Brief overview: The installation takes place in multiple steps:
  1. (WeChat) Get WeChat Developer Sandbox Account
  2. (WeChat) Get WeChat Official Account
  3. (BBP) Create new WeChat bot account on Business Bot Platform

Step 1: (WeChat) Get WeChat Developer Sandbox Account

As a developer you always want your environment to test and play with different features. This is normally quite a mission but with WeChat it is easy.

This can be created by going to WeChat English Sandbox. In case that your login does not work, go to this link (You can use Google Chrome’s translation plugin to translate the page). Also note the mobile number needs to be in the format +49123456789

Scan the QR code with WeChat app on your mobile device to log in.

The appID, URL, Token are the only fields we need to worry about for the setup.

As soon as you save the setting, a green popup should appear at the top of the web page for a few seconds. This means that WeChat has successfully linked your URL to your Sandbox account.

Scan QR code of your sandbox account

If you scroll down on your sandbox account dashboard, you will see a QR code. Scan the QA code to open the sandbox chat dialogue and send messages to the Business Bot platform.

This completes the configuration.

Step 2: (WeChat) Get WeChat Official Account

The main difference is to do with registration. To register a business public account you must have a Chinese business license or a Chinese partner to help you.

To register a personal public account you have to use a Chinese ID number. The ID number does not necessarily need to be the person who owns the account, but has to be a legitimate ID number.

It’s important to note at this point that a Chinese ID number can only be used to register two different WeChat personal public accounts.

For further information please contact us directly.

Step 3: (BBP) Create new WeChat bot account on Business Bot Platform

To create a new WeChat account, follow these steps:

  1. First, log on to the Business Bot Platform
  2. Select Bot AdministrationInstant Messenger AccountsCreate Bot Account. The following data is required to create the bot account:

    Field Example value
    Name: MyWeChatBotKonto
    Description : BotAccount for Dept. Z
    Instant Messenger: WeChat
  3. The bot account has now been created and must be configured with the Instant Messenger account information. To do this, click on the Settings icon and modify the following parameters:

    Fields Description Example value
    Messenger.WebhookId This Webhook ID is unique and is generated by the Business Bot platform (e.g. https://demo.bbp.local/bbp/webhook/) 42da2023-0187-4ab7-94ec-c843153bb36a
    WeChat.AppId Application identifier of the official WeChat account Wx758471f25410304f
    WeChat.AppSecret The appsecret of the official WeChat account (32 hexadecimal string) 72ebc4dc04d288ae8b6182eb72589473
    WeChat.Token Key for accessing the BBP Webhook secrettoken
    WeChat.Encoding.AES.Key Message secret key, if don’t set then message is cleartext TUkvMW2Z6zVVPS4BXKIIRA=

This completes the configuration.

The user account for the bot is now configured and will be used later when creating a bot for WeChat.