強制登出代理程式端點可讓您強制登出線上代理程式。如果客服人員正在進行通話或即時通訊,系統會在他們完成目前的互動後自動登出。系統會立即登出閒置的服務專員。這個端點支援強制登出特定服務專員、整個團隊,或以 CIDR 標記法、IPv4/IPv6 位址清單或 IP 範圍識別的服務專員。如果代理程式數量眾多,系統會建立背景工作,有效管理登出程序。
以下是強制代理程式登出 API 端點:
強制登出服務專員
這個端點可讓特定代理程式登出。代理程式可透過下列方式識別:
服務專員 ID。
團隊 ID。
完全不需要外部 IP 位址
端點:
Method: POST
Type: RAW
URL: https://{subdomain}.{domain}/apps/api/v1/agent_statuses/force_logout
標題:
| 鍵 | 值 | 說明 |
|---|---|---|
| Content-Type | application/json | |
| 接受 | application/json |
內文:
{
"agent_ids": [
11,
12
],
"team_ids": [
1
],
"ip_addrs": [
"34.211.11.0/24"
]
}
要求和回應範例
下列各節提供端點的要求範例。
成功登出服務專員
這個範例說明如何根據代理程式 ID 和團隊 ID 登出特定代理程式。在本例中,這些 ID 分別是專員 ID 11 和 12,以及團隊 ID 1。
要求
標題:
| 鍵 | 值 | 說明 |
|---|---|---|
| Content-Type | application/json |
內文:
{
"agent_ids": [
11,
12
],
"team_ids": [
1
]
}
回應
[
{
"agent_id": 11,
"name": "Darth Vader",
"email": "notanakinskywalker@empire.com",
"agent_number": "Agent No.111",
"previous_status": "lunch",
"current_status": "Offline"
},
{
"agent_id": 12,
"name": "Craig T",
"email": "craigT@nelson.com",
"agent_number": "Agent No.112",
"previous_status": "Unavailable",
"current_status": "Offline"
},
{
"agent_id": 13,
"name": "Raymond D",
"email": "rayd@nelson.com",
"agent_number": "Agent No.113",
"previous_status": "Break",
"current_status": "Offline"
}
]
狀態碼:200
使用 IP 位址成功登出代理程式
這個範例說明如何指定 IP 位址範圍,登出代理程式。在本例中,提供的 IP 位址範圍為 34.211.11.0/24。
要求
標題:
| 鍵 | 值 | 說明 |
|---|---|---|
| Content-Type | application/json |
內文:
{
"agent_ids": [
11,
12
],
"team_ids": [
1
],
"ip_addrs": [
"34.211.11.0/24"
]
}
狀態碼:200
已建立登出代理工作
本例示範如何要求專員登出,以及建立的結果工作。
要求
標題:
| 鍵 | 值 | 說明 |
|---|---|---|
| Content-Type | application/json |
內文:
{
"agent_ids": [
11,
12
],
"team_ids": [
1
],
"ip_addrs": [
"34.211.11.0/24"
]
}
回應
{
"ip_addrs": [
"34.211.11.0/16"
]
}
狀態碼:200
通話中或即時通訊中的服務專員稍後會登出
這個範例說明通話或即時通訊結束後,系統稍後會如何登出通話或即時通訊中的服務專員。
要求
標題:
| 鍵 | 值 | 說明 |
|---|---|---|
| Content-Type | application/json |
內文:
{
"agent_ids": [
11,
12
],
"team_ids": []
}
回應
[
{
"agent_id": 11,
"name": "Darth Vader",
"email": "notanakinskywalker@empire.com",
"agent_number": "Agent No.111",
"previous_status": "In-call",
"current_status": "In-call",
"message": "will force logout as soon as the ongoing call/chat is completed"
},
{
"agent_id": 12,
"name": "Craig T",
"email": "craigT@nelson.com",
"agent_number": "Agent No.112",
"previous_status": "In-chat",
"current_status": "In-chat",
"message": "will force logout as soon as the ongoing call/chat is completed"
}
]
狀態碼:400
錯誤:找不到代理程式
這個範例示範了找不到所提供代理程式的失敗情境。
要求
標題:
| 鍵 | 值 | 說明 |
|---|---|---|
| Content-Type | application/json |
內文:
{
"ip_addrs": [
"34.211.11.0/24"
]
}
回覆:錯誤:無法根據輸入參數找到任何代理程式
{
"message": "cannot find any agent by input params"
}
狀態碼:400
強制執行代理程式登出工作
這個端點可讓您取得代理程式強制登出要求的狀態。
{
"identifier": "string",
"email": "string",
"name": "string",
"phone": "string"
}
端點:
Method: GET
Type:
URL: https://{subdomain}.{domain}/apps/api/v1/agent_statuses/force_logout/jobs/:id
標題:
| 鍵 | 值 | 說明 |
|---|---|---|
| id | 已提交強制登出要求的作業 ID。 |
要求和回應範例
下列各節提供端點的要求範例。
順利完成
這個範例示範如何擷取已順利完成的工作。
要求
標題:
| 鍵 | 值 | 說明 |
|---|---|---|
| Content-Type | application/json |
查詢:
Method: GET
Type:
URL: https://{subdomain}.{domain}/apps/api/v1/agent_statuses/force_logout/jobs/105
回應
{
"id": 105,
"status": "completed"
}
狀態碼:200