透過 API 進行中途驗證

本頁說明如何在 SDK 管道中使用通話和即時通訊 API 端點,進行會期中驗證。

使用者不必驗證身分,即可發起支援工作階段,例如支援即時通訊。如果需要進行使用者驗證,您可以啟動驗證流程。驗證成功後,您可以更新 end_user 識別碼,將工作階段連結至已驗證的終端使用者。

URI 和驗證

這個新端點的基礎 URI 會因 comm_type 而異。

針對 call comm_type:

POST https://<subdomain>.<domain>//apps/api/v1/calls/:call_id/end_user

針對 chat comm_type:

POST https://<subdomain>.<domain>//apps/api/v1/chats/:chat_id/end_user

API 作業

參數

API 要求主體應包含下列欄位:

ID 欄位名稱 類型 是否必要? 說明 範例值
0 identifier String 提供的外部專屬 ID。
1 name 字串 與互動相關聯的通用名稱或 ID。協助查詢顧客。 John Doe
2 年 email 字串 與互動相關聯的一般電子郵件地址。協助查詢顧客。 john@doe.com
3 phone String 與互動相關聯的一般電話號碼。協助查詢顧客。 123-456-7890

API 範例

API 回應範例

成功回應範例:

202 Accepted

{
 "message": "accepted"
}

失敗回應範例

缺少參數
400 {"message": "param is missing or the value is empty: comm_type"}
400 {"message": "param is missing or the value is empty: identifier"}
參照通話或即時通訊以外的通訊類型
404 {"message": "Not Found"}
工作階段未啟用
400 {"message": "Call is already ended"}
400 {"message": "Chat is already ended"}
不支援的 CRM 要求
400 {"message": "Unsupported CRM request"}
要求重複
400 {"message": "Duplicate request: Please wait for the interval to expire"}

API 要求範例

通訊類型

POST https://<subdomain>.<domain>/apps/api/v1/calls/:call_id/end_user
Content-Type: application/json
Authorization: Bearer <your_access_token>

{
    "identifier": "unique_external_id",
    "name": "John Doe",
    "email": "johndoe@example.com",
    "phone": "123-456-7890"
}

即時通訊類型

POST https://<subdomain>.<domain>/apps/api/v1/chats/:chat_id/end_user
Content-Type: application/json
Authorization: Bearer <your_access_token>

{
    "identifier": "unique_external_id",
    "name": "Jane Smith",
    "email": "janesmith@example.com",
    "phone": "098-765-4321"
}

應用程式 API 說明文件

如需其他應用程式 API 端點,請參閱 Apps API Publication