> For the complete documentation index, see [llms.txt](https://library.zoom.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://library.zoom.com/technical-library/zh-tw/shang-wu-fu-wu/zoom-contact-center/expert-insights/integrate-engagement-data.md).

# 整合互動資料

### 概覽

Zoom Contact Center 在每次客戶互動期間都會產生有價值的互動資料，包括通話錄音、轉錄稿、客服人員備註與處置結果。繼續閱讀以了解如何將互動資料儲存在外部系統（例如 CRM 與其他記錄系統）中，以建立統一的客戶視圖、支援有效的客服人員培訓，或在使用 Zoom Contact Center 時滿足合規要求。

我們將拆解不同的整合方法，協助你根據客服人員如何以更高效率運作來選擇最佳做法。

最佳方法主要取決於一個關鍵因素： **客服人員處理互動的應用程式**。我們將討論的兩個選項是：

1. 在 CRM 內使用開箱即用的 ZCC CRM CTI 連接器的客服人員。
2. 在 Zoom Workplace 應用程式中工作的客服人員，這需要使用 ZCC API 與 Webhook 的自訂解決方案。

***

### 開箱即用的 CRM CTI 連接器整合

這是最直接的方法。如果你的客服人員使用 ZCC CRM CTI 連接器，大多數互動資料都能在 Zoom 平台與對應的 CRM 之間自動同步。

#### <mark style="color:藍色;">運作方式</mark>

CTI 連接器會將 ZCC 客服人員介面直接嵌入 CRM 中。當互動結束時，錄音、轉錄稿、備註和處置結果等資料會自動儲存在 Zoom 中，並連結到 CRM 中相關的記錄（例如工單或聯絡人）。

#### <mark style="color:藍色;">設定需求</mark>

可在 Zoom 與 CRM 之間同步資料的功能是「開箱即用」的，但需要在 ZCC 管理入口網站中啟用。

請完成下列步驟：

{% stepper %}
{% step %}
**在 ZCC 管理入口網站中啟用**

以管理員身分登入 Zoom 管理入口網站，然後前往 Contact Center Management > Integrations > Applications。

找到相關的 CRM 整合，並啟用適當設定，以允許資料儲存至你的 CRM。
{% endstep %}

{% step %}
**CRM 權限**

請檢閱並遵循 [CRM 整合設定指南](https://support.zoom.com/) 以確認你的 CRM 整合使用者對所有相關物件具備必要的寫入權限。
{% endstep %}
{% endstepper %}

#### <mark style="color:藍色;">支援的 CRM 平台</mark>

當客服人員使用以下 CRM 時，可透過 ZCC CRM CTI 連接器使用此功能：

* Salesforce
* Zendesk
* ServiceNow
* Microsoft Dynamics
* HubSpot

使用 CRM CTI 連接器時，不需要任何特殊設定，整合會預設將互動資料儲存到 CRM 中。

***

### 透過 API 的自訂整合

如果你的客服人員使用原生 Zoom Workplace 應用程式或 ZCC Smart Embed，你將需要自訂解決方案來傳送互動資料。主要方式是使用 Zoom Contact Center API。

透過 API 存取互動資料主要有兩種方法：

* **輪詢：** 定期查詢 Zoom API，以確認是否有新的互動資料可用。
* **Webhook：** 一旦轉錄稿準備就緒，立即從 Zoom 接收即時通知。

另外還有第三種方法， **Flow 事件整合**，它適用於某些資料類型。

#### <mark style="color:藍色;">輪詢 Zoom Contact Center API</mark>

若要下載互動資料，你必須查詢適當的 ZCC API 端點。請注意，不同類型的資料來自不同的 API，因此你很可能需要為每個相關端點建立輪詢邏輯。

Reports V2（CX Analytics）中的許多與互動相關 API 現已支援具備以下條件的結束時間篩選： `end_time_from` 與 `end_time_to`。若可用，請優先使用這些參數，讓你的輪詢作業能根據互動實際結束的時間擷取資料。這有助於減少漏掉的記錄，因為完整的互動資料（包括 Report V2 資料）會在互動結束時完成定稿。

| 若要取得此資料...                     | 輪詢此 API...                                                                                                                                                                                                                                                                                                          | 使用此欄位...         | 備註：                             |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ------------------------------- |
| <p>錄音媒體檔案</p><p>（語音與視訊頻道）</p>  | <p><a href="https://developers.zoom.us/docs/api/contact-center/#tag/recordings/get/contact_center/recordings">列出錄音</a> 或</p><p>列出互動錄音</p>                                                                                                                                                                           | `download_url`   | 需要先為佇列啟用通話錄音。                   |
| <p>錄音轉錄稿</p><p>（語音與視訊頻道）</p>   | <p><a href="https://developers.zoom.us/docs/api/contact-center/#tag/recordings/GET/contact_center/recordings">列出錄音</a> 或</p><p>列出互動錄音</p>                                                                                                                                                                           | `transcript_url` | 需要已啟用通話錄音與轉錄功能。                 |
| <p>轉錄稿</p><p>（訊息頻道）</p>        | <p><a href="https://developers.zoom.us/docs/api/contact-center/#tag/engagements/get/contact_center/engagements/{engagementId}">取得互動</a> 或</p><p><a href="https://developers.zoom.us/docs/api/contact-center/#tag/reports-v2-cx-analytics/get/contact_center/analytics/log/historical/engagement">列出歷史互動記錄資料</a></p> | `transcript_url` | 訊息頻道預設已啟用轉錄稿。                   |
| <p>狀態</p><p>（所有頻道）</p>         | <p><a href="https://developers.zoom.us/docs/api/contact-center/#tag/engagements/get/contact_center/engagements/{engagementId}">取得互動</a> 或</p><p><a href="https://developers.zoom.us/docs/api/contact-center/#tag/reports-v2-cx-analytics/get/contact_center/analytics/log/historical/engagement">列出歷史互動記錄資料</a></p> | `處置結果`           | 一個處置物件陣列。                       |
| <p>備註</p><p>（所有頻道）</p>         | <p><a href="https://developers.zoom.us/docs/api/contact-center/#tag/engagements/get/contact_center/engagements/{engagementId}">取得互動</a> 或</p><p><a href="https://developers.zoom.us/docs/api/contact-center/#tag/reports-v2-cx-analytics/get/contact_center/analytics/log/historical/engagement">列出歷史互動記錄資料</a></p> | `notes`          | 一個備註物件陣列。                       |
| <p>語音信箱媒體檔案</p><p><br><br></p> | <p><a href="https://developers.zoom.us/docs/api/contact-center/#tag/inboxes/GET/contact_center/inboxes/messages">列出帳戶的收件匣訊息</a> <strong>或</strong></p><p><a href="https://developers.zoom.us/docs/api/contact-center/#tag/inboxes/GET/contact_center/inboxes/{inboxId}/messages">列出收件匣的訊息</a></p>                   | `download_url`   | 適用於留在 Contact Center 收件匣中的語音信箱。 |
| 語音信箱轉錄稿                        | <p><a href="https://developers.zoom.us/docs/api/contact-center/#tag/inboxes/GET/contact_center/inboxes/messages">列出帳戶的收件匣訊息</a> <strong>或</strong></p><p><a href="https://developers.zoom.us/docs/api/contact-center/#tag/inboxes/GET/contact_center/inboxes/{inboxId}/messages">列出收件匣的訊息</a></p>                   | `transcript_url` | 需要先為收件匣啟用轉錄功能。                  |

{% hint style="danger" %}
**警告**

這些下載 URL（`download_url`, `transcript_url`, `playback_url`等）由這些 Zoom API 提供的是 **不** 公開連結。它們是為程式化存取而設計，並需要 API 驗證（例如在 Authorization 標頭中提供存取權杖）才能下載相關檔案。

這表示：

* 你不能將這些 URL 直接儲存在 CRM 中供使用者點擊。使用者在瀏覽器中點擊連結時不會通過驗證，因此下載將會失敗。
* 正確的做法是讓後端服務使用該 URL 取得檔案。你的服務接著可以將檔案儲存在自己的系統中（例如 Amazon S3、Azure Blob Storage，或 CRM 的檔案儲存空間），再從那裡提供給使用者一個安全連結。
  {% endhint %}

{% hint style="warning" %}
**請注意**

**處理延遲－語音與視訊錄音：**

這些資料不會在通話結束的瞬間立即可用。音訊必須先經過處理並上傳，長通話可能需要幾分鐘。為確保不會漏掉錄音，請將 `query_date_type` 參數設為 `recording_end_time` 在輪詢 List recordings API 時使用。這會根據處理完成時間擷取資料，而不是通話結束時間。

對於 Reports V2（CX Analytics）以互動為中心的對帳作業，請使用重疊時間區間與 `end_time_from` 與 `end_time_to` 以便為延遲處理與暫時性傳遞問題提供緩衝。
{% endhint %}

如需更多有關 Zoom Contact Center API 的資訊，請參閱 [Contact Center API](https://developers.zoom.us/docs/api/contact-center/) 文件。

#### <mark style="color:藍色;">使用 Webhook 取得即時事件</mark>

若要採用更即時、以事件驅動的方式，你可以訂閱 ZCC Webhook。這是近乎即時整合最有效率的方法。

**運作方式**

1. 在 Zoom App Marketplace 中訂閱適當的事件。
2. 當事件發生時，Zoom 會將通知傳送到你的 Webhook URL（或你的 WebSocket 連線）。
3. 事件負載包含你所需的資料，可能是直接提供，也可能是 URL/ID 供後續 API 呼叫使用。

**互動資料的常見 Webhook 事件**

* **互動結束資料就緒：** contact\_center.cx\_engagement\_end\_data\_ready（表示互動結束的 Report V2 資料已可擷取）
* **語音/視訊錄音：** contact\_center.recording\_completed（提供一個 `download_url`)
* **語音/視訊轉錄稿：** contact\_center.recording\_transcript\_completed（提供一個 `transcript_url`)
* **訊息轉錄稿：** contact\_center.engagement\_messaging\_transcript\_completed（提供一個 `transcript_url`)
* **備註：** contact\_center.engagement\_note\_added（提供一個 `備註` 欄位，其中包含備註資料）
* **處置結果：** contact\_center.engagement\_disposition\_added（提供一個 `disposition_name` 欄位，其中包含處置資料）

**建議模式：在互動資料就緒時觸發擷取**

當你收到 `contact_center.cx_engagement_end_data_ready`時，請將其視為該互動的 Report V2 結束資料已完成的訊號。此時，呼叫 Historical Engagement log data API 以及其他相關 API，以收集最終資料集。在此事件中，使用 `engagement_id` 作為查詢鍵，然後從你所需的端點擷取完整的互動產物。

{% hint style="warning" %}
**請注意**

* **留意多重事件：** 此 `note_added` 與 `disposition_added` 事件可能會在單一互動中觸發多次（例如，若客服人員儲存多則備註或通話被轉接）。你的應用程式邏輯必須能夠處理這種情況。
* **建立冗餘機制：** 事件傳遞並不總是能 100% 保證（例如，你的端點或 WebSocket 連線可能暫時中斷）。
* **備援策略：** 我們建議使用輪詢 API 搭配 `end_time_from` 與 `end_time_to` 時間區間執行對帳指令碼，以捕捉遺漏的事件並補齊資料缺口。
  {% endhint %}

如需更多有關 Zoom Contact Center Webhook/WebSocket 事件的資訊，請參閱 [Contact Center Webhook](https://developers.zoom.us/docs/api/contact-center/events/) 文件。

#### <mark style="color:藍色;">Flow 事件整合</mark>

對於某些資料類型，你可以在 ZCC Flow 編輯器中使用 JavaScript 事件指令碼，直接將資料推送到外部系統。

**支援的資料與限制：**

* **處置結果：** 可透過以下項目，於所有傳入互動頻道類型中存取： `global_system.Engagement.disposition` 變數。
* **轉錄稿：** 僅可透過以下項目，用於傳入訊息互動（例如 Web Chat）存取： `global_system.Engagement.transcript` 變數。
* **多個 Flow：** 當你的設定中有多個 Flow，特別是當其中一個 Flow 使用 `RouteTo` 小工具連接到另一個 Flow 時，務必確保所有 Flow 都已正確設定相同的事件指令碼與觸發條件。

這種方法在訊息 Flow 中最強大，因為你可以在單一事件中同時結合轉錄稿與處置結果。

**設定步驟**

請依照下列步驟設定你的 flow：

{% stepper %}
{% step %}
**新增事件指令碼**

在你的 ZCC Flow 中（例如 Web Chat flow），點選 Start 小工具。

找到 Event Scripts，並為 Engagement Closed 和/或 Disposition Saved 等事件新增事件指令碼。

<div align="left"><figure><img src="/files/b8479438903481d8b93cc40eaab35521b5564b55" alt="Flow screen showing a welcome message and events."><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**新增你的自訂 JavaScript**

以下範例會同時取得處置結果與轉錄稿，然後將它們一起傳送到外部 API。

```javascript
async function main () { 
  try {
    // 從其變數取得處置物件
    const disposition_data = var_get()['global_system.Engagement.disposition'];
    
    // 取得完整的轉錄稿物件
    const transcript_data = await req.get(var_get()['global_system.Engagement.transcript']);

    // 準備包含你想傳送之所有資料的負載
    const payload_to_send = {
      disposition: disposition_data.data.result,
      transcript: transcript_data.data.result.transcript
    };

    // 定義資料的目的地
    const external_api_url = '<replace-with-your-api-endpoint>';
    
    // 將合併後的資料傳送到你的外部系統
  	const response = await req.post(external_api_url, payload_to_send);
    
    // 記錄外部系統的回應以便疑難排解
    log.debug("外部 API 回應：" + JSON.stringify(response.data));
    
  } catch (error) {
    log.debug("轉錄稿事件指令碼中發生錯誤：" + error);
  }
}
```

{% endstep %}
{% endstepper %}

***

### 摘要與建議

選擇最符合你的客服人員工作流程與技術資源的整合方法。

| 如果你的客服人員使用...                    | 那麼你最好的選擇是...               | 關鍵考量：                                                                                                                                                                                          |
| -------------------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 支援的 CRM 中的 ZCC CTI 連接器           | 內建整合                       | <ul><li>最簡單的途徑</li><li>不需要程式碼</li><li>內建互動資料同步</li></ul>                                                                                                                                       |
| Zoom Workplace 應用程式或 Smart Embed | API Webhook 加上以結束時間篩選的輪詢對帳 | <ul><li>使用 <code>contact\_center.cx\_engagement\_end\_data\_ready</code> 作為你的擷取觸發條件</li><li>然後搭配 <code>end\_time\_from</code>/<code>end\_time\_to</code> 時間區間</li><li>提升效率，同時減少遺漏的互動</li></ul> |
| 傳入訊息 Flow（且需要推送資料）               | Flow 事件指令碼                 | <ul><li>利基，但強大</li><li>需要 JavaScript</li><li>最適合用來傳送訊息轉錄稿與處置結果</li></ul>                                                                                                                       |

透過了解這些不同路徑，你可以建立一個穩健且可靠的整合，讓你完整掌握客戶互動。將事件觸發式擷取與以結束時間篩選的對帳相結合，有助於減少不必要的 API 呼叫，同時提升完整性。


---

# 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 dynamically by asking a question.

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

```
GET https://library.zoom.com/technical-library/zh-tw/shang-wu-fu-wu/zoom-contact-center/expert-insights/integrate-engagement-data.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
