# WeChat

Follow this guide to connect your WeChat Official Account to chatalog as a new inbox so that you can manage all your channels in one place and set up different automation features!

{% hint style="warning" %}
If you do not have a WeChat Official Account, please register a WeChat Service Account [here.](https://mp.weixin.qq.com/cgi-bin/registermidpage?action=index\&lang=en_US\&token=)  You may follow the step-by-step guide [here](https://kf.qq.com/faq/120911VrYVrA151013MfYvYV.html).
{% endhint %}

### Before you start

Before you start connecting your WeChat Official Account as a new inbox, you will need the following information from your WeChat Official Account :

* Original ID
* App ID
* APP Secret

### Where to find your Original ID, APP ID, and APP Secret?

Firstly, you need to log in to your [WeChat Dashboard](https://mp.weixin.qq.com/).

#### Original ID

Click **"Account Info"**  in the *Settings and Development section* from the left sidebar. Scroll down to find the **Original ID** in the Registration information section. Copy the **Original ID** for later usage.

<figure><img src="https://605198658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2FIuZs3lRZMvIV6obFn5Rt%2Fimage.png?alt=media&#x26;token=03f89323-dbd9-4e6b-9154-b20685ef6aa0" alt=""><figcaption></figcaption></figure>

#### APP ID

Click **"Basic Configuration"**  in the *Settings and Development section* from the left sidebar. You can find **Developer ID (AppID)** and **Developer Password (AppSecret)** below the Official Account development information. Copy the **AppID** for later usage.

<figure><img src="https://605198658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2F5rq3oxdZCoHIUIfo45Nv%2Fwechat%20basic%20config.png?alt=media&#x26;token=3afc87aa-b5b5-4e3c-aa7b-bf311101c084" alt="" width="563"><figcaption></figcaption></figure>

#### APP Secret

To generate the **AppSecret,** you have to pass two verification steps.&#x20;

You have to **scan a QR code** on the webpage. You'll need to **re-enter your account password.** Once you have completed the security measures, a brand new App Secret will be generated. Copy the **AppSecret** for later usage.

### Now you start connecting to WeChat Inbox

Go to your chatalog's home page, click '**Connect**,' and click on the WeChat inbox icon.&#x20;

<figure><img src="https://605198658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2FdYx1wxsTim73LpZLku4k%2Fimage.png?alt=media&#x26;token=ec9342e0-b1d6-4765-9a2b-fdc522e3e3a8" alt=""><figcaption></figcaption></figure>

<figure><img src="https://605198658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2Faq9588hgveKI3XbyWG75%2Fimage.png?alt=media&#x26;token=84a908ae-918e-4d5c-b0a3-844127db8b52" alt=""><figcaption></figcaption></figure>

#### Step 1: Fill in the Inbox Name&#x20;

Think of a good name that will help you easily know what this inbox is about)

#### Step 2: Fill in the following information copied from your WeChat Dashboard earlier

* Original ID&#x20;
* App ID
* APP Secret

Click **Update** after you filled in the Inbox Name, Original ID, App ID, and App Secret.

<figure><img src="https://605198658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2FostLtRYWrNAx9Op5YucU%2Fimage.png?alt=media&#x26;token=4ec42513-5326-4f70-b326-7cd1929c72d2" alt=""><figcaption></figcaption></figure>

#### Webhook URL and Token

After you click **Update** from the previous step, you will see the **Webhook Url** and **Token** provided by chatalog. Copy the Webhook Url and Token and paste them back into your WeChat Dashboard.

<figure><img src="https://605198658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2FYYyP5OrYAWBbw9iYnnQK%2Fimage.png?alt=media&#x26;token=9d294e44-69f7-4ae1-899e-a8824a3e43e6" alt=""><figcaption></figcaption></figure>

#### How to paste Webhook URL and Token into WeChat Dashboard

In the Basic Configuration page of your WeChat Dashboard, click on the **"Change Configuration"** button to open up the Configuration menu.

Copy the **Webhook Url** and **Token** provided by chatalog and paste them into their respective fields.

Generate an Encoding AES key and select **" 明文模式 | Plain Text Mode"** for message encryption.

<figure><img src="https://605198658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2FR0XDwegDEeE5cRGElM9w%2Fwechat%20basic%20config.png?alt=media&#x26;token=31619ac0-8d4e-470e-a498-3c845b8b73ac" alt=""><figcaption></figcaption></figure>

<figure><img src="https://605198658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2FkiKcYe7TWK5Xnx0wiijF%2Fimage.png?alt=media&#x26;token=87ed5640-bded-4b89-b112-ed6ddf1c4a16" alt=""><figcaption></figcaption></figure>

Submit your changes. Remember to click “**Enable**” after making any configuration change.&#x20;

<figure><img src="https://605198658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2FACJwgGmWOzbffvzTxv4m%2Fimage.png?alt=media&#x26;token=0dac4a7a-6338-4aad-b694-eb7ec24ce196" alt=""><figcaption></figcaption></figure>

### Add IP Whitelist

Also, you need to put chatalog's IP address in the IP whitelist.

<figure><img src="https://605198658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2FfZVExk4B0VwFezcAx7iY%2Fimage.png?alt=media&#x26;token=6eb26992-f015-43c0-bc09-24b0f4c72791" alt=""><figcaption></figcaption></figure>

Add these chatalog's IP addresses to your whitelist and confirm the modification.

> 35.229.153.39
>
> 34.96.220.218
>
> 34.96.222.188

<figure><img src="https://605198658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2Fl1LKNq0mghasqIsooQJm%2Fimage.png?alt=media&#x26;token=91a20e23-a684-4934-b3ce-fa7b69589d19" alt=""><figcaption></figcaption></figure>

Click [here](https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement\&key=1495617578\&version=1\&lang=zh_CN\&platform=2\&token=1390417593) if you want to read more about WeChat's added access white list protection for the access\_token interface document.

Then you can return to chatalog and find your WeChat inbox ready.

<figure><img src="https://605198658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP7nf2G1iCRba8EP7DawZ%2Fuploads%2F0Fm5h6HLT9ibT9YSYCjx%2Fimage.png?alt=media&#x26;token=b5e4df82-0f73-4e8f-bfa8-f10cdfa2b23d" alt=""><figcaption></figcaption></figure>

Congratulations! Now you've finished the setup for connecting a new WeChat inbox!
