> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/build/choose-channel/whatsapp.md).

# 串接對話平台：WhatsApp

串接 WhatsApp 對話平台：準備 Meta Business 帳號與 WhatsApp Business API 憑證，在 MaiAgent 新增對話平台並綁定 Agent。

## 串接前確認 <a href="#pre-integration-checklist" id="pre-integration-checklist"></a>

* 已在 [MaiAgent 平台](https://admin.maiagent.ai/)上建立好一個「AI 助理」
* 已擁有 [Meta Business](https://business.facebook.com/) 帳號
* 已建立 WhatsApp Business 帳號並綁定電話號碼

## 開始串接 <a href="#start-integration" id="start-integration"></a>

### 1. 進入串接對話平台頁面 <a href="#step-go-to-channel-page" id="step-go-to-channel-page"></a>

在左側選單點選 <mark style="color:blue;">對話平台</mark>，點擊右上角 <mark style="color:blue;">串接對話平台</mark> 按鈕。

### 2. 選擇 WhatsApp <a href="#step-select-whatsapp" id="step-select-whatsapp"></a>

在平台選擇頁面中，點擊 <mark style="color:blue;">WhatsApp</mark>。

### 3. 連接 Facebook 帳號 <a href="#step-connect-facebook-account" id="step-connect-facebook-account"></a>

點擊 <mark style="color:blue;">連接 WhatsApp</mark> 按鈕，系統會開啟 Facebook OAuth 登入視窗。

1. 登入您的 Facebook 帳號
2. 授權 MaiAgent 存取 WhatsApp Business 管理權限
3. 授權完成後，視窗會自動關閉並回到設定頁面

{% hint style="warning" %}
請確認瀏覽器允許彈出視窗，否則 OAuth 登入視窗可能被封鎖。
{% endhint %}

### 4. 選擇 WhatsApp Business 帳號與電話號碼 <a href="#step-select-whatsapp-business-account-and-phone" id="step-select-whatsapp-business-account-and-phone"></a>

OAuth 授權完成後：

1. 從 <mark style="color:blue;">選擇 WhatsApp Business 帳號</mark> 下拉選單中，選擇要串接的商業帳號
2. 從 <mark style="color:blue;">選擇電話號碼</mark> 下拉選單中，選擇要接收訊息的電話號碼

### 5. 基本設定 <a href="#step-basic-settings" id="step-basic-settings"></a>

| 欄位         | 說明                           |
| ---------- | ---------------------------- |
| **對話平台名稱** | 為此串接取一個名稱，方便辨識               |
| **AI 助理**  | 選擇要綁定的 Agent                 |
| **重置指令**   | （選填）設定讓使用者重新開始對話的指令，例如「重新開始」 |

### 6. 儲存設定 <a href="#step-save-settings" id="step-save-settings"></a>

確認設定無誤後，點擊 <mark style="color:blue;">儲存</mark> 完成串接。

串接完成後，使用者透過 WhatsApp 傳送訊息至該電話號碼時，Agent 就會自動回覆。

{% hint style="info" %}
串接成功後，您可以在對話平台列表中找到此串接，點擊編輯可進一步設定功能選項（OCR 辨識、時段回覆、權限控管等）。
{% endhint %}

## 訊息格式與連續訊息 <a href="#message-format-and-merging" id="message-format-and-merging"></a>

* **Markdown 自動轉文字**：Agent 回覆中的標題、連結、表格、程式碼等 Markdown 語法在送到 WhatsApp 前會自動轉成純文字（連結變成「文字 網址」），粗體則改用 WhatsApp 自己的 `*粗體*` 樣式；真人客服打的字不受影響，見 [訊息內容渲染優化：通訊軟體通道](/build/choose-channel/web-chat/markdown-rendering.md#messaging-channels-plain-text)
* **連續訊息合併成一輪**：使用者連續傳多張圖片、或先傳圖再打字時，Agent 會等這一串訊息到齊（只含圖片的訊息，最後一則後約 4 秒沒有新訊息才回答，最長約 20 秒，收到文字就立刻回）後一次回答；同一對話一次只處理一輪


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/build/choose-channel/whatsapp.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
