# 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="/files/BRcXQTFRvceXtl8TtwdU" 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="/files/xXtmTbCSdvEJbLhNdKbW" 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="/files/yoIx0GvD3fEU942J6Irn" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/kbGrkfdc9e90sBOCMyHy" 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="/files/kkUslr9ki262HtmNk7Jc" 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="/files/ggxdOBhq8shJPGniR2Bq" 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="/files/HmCFcToJHKil0XeMNgN5" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/7oOZjgosWpA6a4pXjruh" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/CxkxIvPT80B39USxlOeM" alt=""><figcaption></figcaption></figure>

### Add IP Whitelist

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

<figure><img src="/files/xgbiLUWHtkGo2UeR4TE3" 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="/files/48EbunA5KKbOFTaaGxt4" 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="/files/LDV0o15OXcwp2RkCLyqi" alt=""><figcaption></figcaption></figure>

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chatalog.ai/platform-setup/wechat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
