Agent Endpoint 提供了一种获取代理对象的方法。每个代理对象都代表 Contact Center AI 平台 (CCAI Platform) 中的单个代理。查看以下模型,了解哪些字段可能包含个人身份信息 (PII)。
[
{
"id": 0,
"email": "string",
"created_at": "2018-05-30T20:46:31.333Z",
"last_login_time": "2018-05-30T20:46:31.333Z",
"first_name": "string",
"middle_name": "string",
"last_name": "string",
"avatar_url": "string",
"agent_number": "string",
"status": {
"id": 0,
"name": "string",
"color": "string"
},
"status_updated_at": "2018-05-30T20:46:31.333Z",
"crm_authenticated": true,
"online": true,
"wrap_up": true,
"call_count": 0,
"chat_count": 0,
"location": "string",
"roles": [
"agent"
],
"teams": [
{
"id": 0,
"name": "string",
"parent_id": 0,
"position": 0,
"deleted": true,
"agents_count": 0
}
],
"channels": [
{
"channel_type": "chat",
"menu": {
"id": 0,
"name": "string",
"parent_id": 0,
"position": 0,
"deleted": true,
"hidden": "string",
"menu_type": "ivr_menu",
"output_msg": "string"
}
}
]
}
]
代理
/manager/api/v1/agents 端点仅返回活跃代理的代理对象以及实时状态和在线状态数据。此端点不会返回已停用的代理记录。
下表列出了 /manager/api/v1/agents 端点支持的查询参数:
| 参数 | 必填 | 数据类型 | 定义 |
|---|---|---|---|
| 页面 | FALSE | 字符串 | 与“per”搭配使用,表示记录的页数。例如,如果 per 设为 200,page 设为 2,则响应将包含记录 201-400,因为 page 1 包含 1-200。 |
| 每 | FALSE | 字符串 | 与 page 搭配使用,用于指明一页记录中应包含多少条记录。例如,如果 per 设为 200,page 设为 2,则响应将包含记录 201-400,因为 page 1 包含 1-200。 |
| id[] | FALSE | Array[String] | Array[Strings]。要搜索和返回的记录的 ID |
| agent_number[] | FALSE | Array[String] | 管理员在创建代理时分配的代理编号 |
| status_id[] | FALSE | Array[String] | 按代理状态过滤 |
| online[] | FALSE | 布尔值 | 按客服人员是否在线进行过滤 |
| wrap_up[] | FALSE | 布尔值 | 按客服人员是否处于收尾状态过滤 |
| location[] | FALSE | Array[String] | 按代理位置过滤 |
| last_login_time[from] | FALSE | 时间(世界协调时间) | 为上次登录时间字段创建下限。返回的所有记录都将晚于输入的值。 |
| last_login_time[to] | FALSE | 时间(世界协调时间) | 会为上次登录时间字段创建上限。返回的所有记录都将早于输入的值。 |
| status_updated_at[from] | FALSE | 时间(世界协调时间) | 创建 status_updated_at 字段的下限。返回的所有记录都将晚于输入的值。 |
| status_updated_at[to] | FALSE | 时间(世界协调时间) | 创建 status_updated_at 字段的上限。返回的所有记录都将早于输入的值。 |
端点:
Method: GET
Type:
URL: https://{{subdomain}}.{{domain}}/manager/api/v1/agents
更多请求/响应示例:
示例请求:代理示例
Body: None
回应示例:代理示例
[
{
"id": 45,
"email": "craigT@nelson.com",
"roles": [
"agent"
],
"first_name": "Craig T",
"middle_name": null,
"last_name": "Nelson",
"avatar_url": "https://subdomain.somedomain.com/default-profile.png",
"agent_number": null,
"crm_authenticated": false,
"status": {
"id": -6,
"name": "Wrap-up",
"color": "purple",
},
"online": false,
"wrap_up": false,
"call_count": 0,
"chat_count": 0,
"location": null,
"created_at": "2016-11-10T00:15:04.000Z",
"last_login_time": "2016-11-10T00:17:57.000Z",
"status_updated_at": null,
"teams": [
{
"id": 163,
"name": "team CTN",
"parent_id": null,
"position": 11,
"agents_count": 12,
"deleted": false
}
],
"channels": [
{
"channel_type": "voice_call",
"menu": {
"id": 2029,
"name": "Mobile Queue",
"parent_id": null,
"position": 0,
"deleted": false,
"menu_type": "mobile_menu",
"output_msg": null,
"hidden": false
}
}
]
},
{
"id": 60,
"email": "notanakinskywalker@empire.com",
"roles": [
"agent"
],
"first_name": "Darth",
"middle_name": null,
"last_name": "Vader",
"avatar_url": "https://subdomain.somedomain.com/default-profile.png",
"agent_number": null,
"crm_authenticated": false,
"status": {
"id": -7,
"name": "In-call",
"color": "light_blue",
},
"online": false,
"wrap_up": false,
"call_count": 0,
"chat_count": 0,
"location": null,
"created_at": "2017-02-03T19:44:14.000Z",
"last_login_time": "2017-02-03T20:05:31.000Z",
"status_updated_at": "2017-02-04T12:36:11.000Z",
"teams": [],
"channels": [
{
"channel_type": "voice_call",
"menu": {
"id": 1693,
"name": "Premium Support",
"parent_id": null,
"position": 0,
"deleted": false,
"menu_type": "ivr_menu",
"output_msg": "You selected premium support",
"hidden": false
}
}
]
},
{
"id": 81,
"email": "email@email.com",
"roles": [
"agent"
],
"first_name": "Barry",
"middle_name": null,
"last_name": "Allen",
"avatar_url": "https://subdomain.somedomain.com/default-profile.png",
"agent_number": null,
"crm_authenticated": false,
"status": {
"id": -10,
"name": "Offline",
"color": "grey",
},
"online": false,
"wrap_up": false,
"call_count": 0,
"chat_count": 0,
"location": null,
"created_at": "2017-03-13T23:47:39.000Z",
"last_login_time": "2017-03-13T23:48:17.000Z",
"status_updated_at": "2017-03-13T23:56:04.000Z",
"teams": [],
"channels": [
{
"channel_type": "voice_call",
"menu": {
"id": 2028,
"name": "Speed Issues",
"parent_id": 2027,
"position": 0,
"deleted": false,
"menu_type": "mobile_menu",
"output_msg": null,
"hidden": false
}
}
]
}
]
状态代码:200
代理当前状态
“Agents Current Status”(客服人员当前状态)会返回所有已登录的客服人员及其当前状态、处于该状态的时长,以及其他信息(用于指明客服人员是否处于暂停状态以及暂停时长)。
端点:
Method: GET
Type:
URL: https://{{subdomain}}.{{domain}}/manager/api/v1/agents/current_status
更多请求/响应示例:
请求示例:代理当前状态
Body: None
示例回答:智能体的当前状态
[
{
"id": 1,
"status": "Available",
"status_id": 0,
"status_updated_at": "2021-05-10T17:45:01.000Z",
"on_hold": false,
"on_hold_duration": 0
}
]
状态代码:0
API 响应中可能包含无法识别的 JSON 键
所有 API 更新都向后兼容。我们保留随时在现有 API 响应中引入新 JSON 键的权利。我们建议您谨慎处理响应,忽略任何无法识别的键,以确保功能持续正常运行。