Important
This project has been retired and archived
If there is a need of continued use / development of this project for your own needs please feel free to fork the project - which will remain here in archived form.
This node.js example connector allows you to make your Teneo bot available on WeChat. The connector acts as middleware that establishes a conversation between WeChat and Teneo. This guide will take you through the steps of setting up this WeChat connector.
WeChat's website is in mandarin. The instructions below should be able to get you going even if you don't understand Mandarin. If desired however, you may wish to use an extension to translate their website.
Making the connector available via https is preferred. We recommend using ngrok for this.
WeChat app should already be running on your device. If not, download it from an App Store and Sign up for a new account.
Your bot needs to be published and you need to know the engine URL.
- Download or clone the connector source code:
git clone https://github.com/artificialsolutions/tie-api-example-wechat.git
- Install dependencies by running the following command in the folder where you stored the source:
npm install
- Login to the WebChat Dashboard by clicking the green login button on this page: https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login
- A QR code will appear. In the Wechat app, go to the Discover tab and choose 'Scan'. Scan the QR code with the Wechat app, and a sandbox configuration dashboard will be displayed.
- Choose yor own value to use in the
Token
field and copy or remember it, you will need it later. - Next copy the
appID
that is shown in the first row of the first table at the top of the page.
- Create a file called
.env
in the root folder of the project. Give it the following content:Replace the placeholders with the values you copied earlier.APP_ID=<your app id here> TOKEN=<your Token here> TENEO_ENGINE_URL=<your teneo engine url here>
- Start the connector with the following command (replacing the environment variable with the appropriate value):
node server.js
Use ngrok the connector available via https:
- Make sure your connector is available via https. When running locally you can for example use ngrok for this. Run the connector on port 3000 by default.
ngrok http 3000
- Running the command above will display a public https URL, copy it, we will use it as a
URL
value for the following steps.
- Once the connector is available via https, copy the
URL
from the previous step into the URL of Webchat's dashboard online. Also, add a/wechat
suffix to the URL field, so that it looks something like this:http://1234abcd.ngrok.io/wechat
- Tap the green Submit button to save all settings.
- Open WeChat, and tap "Scan" from the 'Discover' tab menu.
- Scan the QR code that appears halfway down the Webchat Dashboard.
- A new chat will appear. You are now ready to chat with your Teneo chatbot.