> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langbot.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy WeCom Bot

Deploy the WeCom (Enterprise WeChat) bot to integrate with LangBot.

<Info title="- This integration is for internal enterprise applications, used within your organization. If external customer support is needed, please refer to the [WeCom Customer Service integration solution](wecomcs).">
  * The WeCom callback address requires a public IP and domain name. We recommend you first follow [Configure HTTP Reverse Proxy](/en/workshop/production/proxy-and-ssl) to configure the LangBot callback address.
</Info>

<Tip>
  **No public server?** [LangBot Cloud](https://space.langbot.app/cloud) includes built-in domain and HTTPS — get WeCom working out of the box.
</Tip>

## Record Corporate ID

Open the [WeCom Admin Portal](https://work.weixin.qq.com/), click `My Enterprise`, and record the `Corporate ID` at the bottom.

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecom/03-corp-id.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=9d768638d67d677fd131f8c19576bd85" alt="Corp ID" width="1436" height="1522" data-path="images/zh/deploy/bots/wecom/wecom/03-corp-id.png" />

## Create Bot

Click `App Management`, then `Build Your Own`, and click `Create App`.

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecom/01-wecom-apps.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=ef00c81f2d25e25777cc7cb47a051f74" alt="App Management" width="2482" height="2170" data-path="images/zh/deploy/bots/wecom/wecom/01-wecom-apps.png" />

Fill in the basic information for the bot:

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecom/02-create-app.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=5a395f4b68f5e2f1f17c47aa82b48a7a" alt="Create Application" width="1537" height="1005" data-path="images/zh/deploy/bots/wecom/wecom/02-create-app.png" />

View and record the bot's secret:

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecom/04-bot-secret.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=fbf9de1ab51b180112149f93dce40d2f" alt="Bot Secret" width="1512" height="1230" data-path="images/zh/deploy/bots/wecom/wecom/04-bot-secret.png" />

Get it from the WeCom client as prompted.

## Enable Contact Sync Permission

<Info title="- This configuration is required for LangBot to support mass messaging. The related code can be found at libs/wecom_api/api.py.">
  * This feature has not been implemented yet as LangBot is still under development.
  * This field can be filled with any random characters, but **cannot be empty**.
</Info>

Click `Security and Management`, then `Management Tools`, `Contact Sync`; configure the trusted IP by adding the IP address of the server where LangBot is deployed.

Click `View Secret` and record it - this is the contacts\_secret (Contact Sync Secret).

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecom/08-contact-secret.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=6f4a75390c604a770138e665fcb370f3" alt="Contact Sync Secret" width="1604" height="1336" data-path="images/zh/deploy/bots/wecom/wecom/08-contact-secret.png" />

## Create Bot on LangBot

On the LangBot bot page, click `Create Bot`, enter a name, select `WeCom`, and fill in the Corporate ID, Bot Secret, and Contact Sync Secret.

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecom/05-fill-in-corpid-secret.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=20ba682bba70fb058ded34bf1f29990b" alt="Create WeCom Bot" width="1264" height="1614" data-path="images/zh/deploy/bots/wecom/wecom/05-fill-in-corpid-secret.png" />

Click submit to enter the bot edit page, then click enable. At this point you'll see the Webhook callback address—copy it:

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecom/06-webhook-callback-address.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=bc7ae8fb05c6cac6de0633e47adbaacf" alt="Webhook Callback Address" width="1634" height="810" data-path="images/zh/deploy/bots/wecom/wecom/06-webhook-callback-address.png" />

## Set Callback Address

Return to the WeCom bot admin page, click `Receive Messages`, `Set API Reception`, and paste LangBot's Webhook callback address into the `URL` field:

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecom/07-set-api-receiver.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=10fde069e44bd060dcadc323844d3ec9" alt="Set API Receiver" width="1784" height="1024" data-path="images/zh/deploy/bots/wecom/wecom/07-set-api-receiver.png" />

Click to randomly generate the Token and EncodingAESKey, and record them. **Keep this page open.** Go back to the LangBot WeCom bot configuration page, enter the Token and EncodingAESKey, and click Save.

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecom/09-save-wecom-bot.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=78a446c2a47fd0f4cd41e83a231d568e" alt="Save WeCom Bot" width="1672" height="1716" data-path="images/zh/deploy/bots/wecom/wecom/09-save-wecom-bot.png" />

Return to the **page where you just filled in the Webhook callback address**, and click Save to complete the configuration. If you see **request URL failed**, please carefully double-check your configuration.

## Configure Corporate Trusted IP

Go back to this application's admin page, find `Enterprise Trusted IP` at the bottom, and add the IP address of your LangBot deployment server.

<img src="https://mintcdn.com/langbot/ccEfWQOd_I5kaF_t/images/zh/deploy/bots/wecom/wecom/10-corp-trusted-ip.png?fit=max&auto=format&n=ccEfWQOd_I5kaF_t&q=85&s=82216ef41d7bb39bea8e6a9828c3c6ee" alt="Corp Trusted IP" width="1796" height="1664" data-path="images/zh/deploy/bots/wecom/wecom/10-corp-trusted-ip.png" />

Click Save.

## FAQ

Q: Can't find the bot chat in WeCom?
A: Go to the app's detail page in WeCom admin, click `Features` > `Send Message` > `Send Message`, choose your own account, send a message, and you will see the bot in your chat window.
