REST API文档
呼叫中心
坐席管理
在 XSwitch 中,坐席跟用户使用同一条记录,坐席就是type
(类型)为AGENT
的用户。如果用户已存在,可以直接将用户的type
改为AGENT
即可,否则,创建一个座席等于创建一个用户。
特别注意
所有涉及密码的接口数据请自行修改为复杂密码,防止因为密码过于简单导致系统被攻击。
创建坐席所需信息说明如下:
参数 | 说明 |
---|---|
name | 名称,如张三,李四 |
login | 坐席工号,登录名 |
extn | 坐席对应的分机号 |
password | 坐席密码,默认强密码 |
extn_password | 分机密码,默认强密码,如空则与坐席密码相同 |
domain | 域名,默认为 xswitch.cn |
context | 呼叫源,默认为 default |
agent_info | 坐席其他参数信息 |
type | 类似,必须为AGENT |
其它参数可以参见用户属性。
坐席参数 agent_info 对应值说明如下:
参数 | 说明 |
---|---|
hardware_phone_only | true/false,是否仅用于硬件话机,用于区分无界面呼叫中心 |
timeout | 呼叫坐席时的超时时间,单位为秒 |
simo | 并发通话数 |
lag | 延迟,接完一个电话后多长时间可以再接下一个电话 |
member_wait | 等待 |
max_no_answer | 最大无应答失败次数,超过该次数后不再对该坐席分配电话 |
warp_up_time | 接完一个电话后,再次进入队列等待时间 |
reject_delay_time | 拒接一个电话后,下次分配电话前的等待时间,默认为 n |
busy_delay_time | 如果座席电话忙,下次分配电话前的等待时间,默认为 n |
type | 坐席类型,callback|standBy ,默认为callback |
level | 等级 |
position | 位置 |
status | 状态 Out|Available|Available(On Demand)|On Break |
token | 用户 Token,放在 HTTP 请求时的 Header 上 |
创建坐席
- 请求 URL:
/api/users
- 请求方式:
POST
- 消息头:
Content-Type: application/json
- Body 信息: 参见用户信息说明
- 返回值: 座席 id
id
,分机 idextn_id
请求 Body:
{ "name": "小樱桃", "login": "1234", "extn": "X1234!@#$", "password": "$VeryGoodPassw0rd", "extn_password": "$VeryGoodPassw0rd", "context": "context-1", "domain": "xswitch.cn", "type": "AGENT" }
创建坐席时,系统默认会自动加入agent_info
的内置参数,默认如下,如需修改坐席agent_info
需要调用PUT
请求进行修改(详情参考修改某个坐席接口):
{ "lag": "2", "simo": "1", "status": "On Break", "agent_type": "callback", "member_wait": "nowait", "wrap_up_time": "10", "max_no_answer": "3", "busy_delay_time": "10", "no_answer_delay_time": "30", "reject_delay_time": "10" }
- curl 示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \ -H "Content-Type: application/json" \ -d '{"name":"小樱桃","login":"1234","password":"$VeryGoodPassw0rd","extn":"1234","extn_password":"$VeryGoodPassw0rd","context":"context-1","domain":"192.168.1.100","type":"AGENT"}' \ 192.168.1.100:8081/api/users
返回值:
{ "code": 200, "message": "success", "data": { "id": "32", "extn_id": "20" } }
批量创建坐席
- 请求 URL:
/api/users/muti_add
- 请求方式:
POST
- 消息头:
Content-Type: application/json
- Body 信息: 参见用户信息说明
- 返回值: 用户对象
请求 Body:
{ "password": "9o0p(O)P", "extn_password": "9o0p(O)P",` "users_start": 20000, "users_end": 20001, "context": "context-1", "domain": "xswitch.cn", "type": "AGENT" }
创建坐席时,系统默认会自动加入agent_info
的内置参数,默认如下,如需修改坐席agent_info
需要调用PUT
请求进行修改(详情参考修改某个坐席接口):
{ "lag": "2", "simo": "1", "status": "On Break", "agent_type": "callback", "member_wait": "nowait", "wrap_up_time": "10", "max_no_answer": "3", "busy_delay_time": "10", "no_answer_delay_time": "30", "reject_delay_time": "10" }
- curl 示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \ -H "Content-Type: application/json" \ -d '{"password":"9o0p(O)P","extn_password":"9o0p(O)P","users_start":20000,"users_end":20001,"context":"context-1","domain":"xswitch.cn","type":"AGENT"}' \ 192.168.31.98:8081/api/users
返回值:
{ "data": [ { "login": "20000", "tel": "", "salt": "$1...s", "updated_at": "2024-07-15 07:30:39", "login_attempts": 0, "created_at": "2024-07-15 07:30:39", "cid_name": "", "cid_number": "", "password": "9o0p(O)P", "context": "context-1", "last_login_attempt_at": "", "extn": "20000", "email": "", "vm_password": "", "domain": "192.168.31.98", "id": 56, "last_login_at": "", "name": "20000", "sha1": "\\x0a0d75ed2afd1...30dd64b4da63c7f", "tel_enabled": 0, "auto_record": 0, "extn_id": 56, "deleted_at": "", "agent_info": { "agent_type": "callback", "busy_delay_time": "10", "status": "On Break", "lag": "2", "simo": "1", "no_answer_delay_time": "30", "reject_delay_time": "10", "member_wait": "nowait", "max_no_answer": "3", "wrap_up_time": "10" }, "type": "AGENT", "is_super": 0, "is_locked": false }, { "login": "20001", "tel": "", "salt": "$1$b...LW", "updated_at": "2024-07-15 07:30:39", "login_attempts": 0, "created_at": "2024-07-15 07:30:39", "cid_name": "", "cid_number": "", "password": "9o0p(O)P", "context": "context-1", "last_login_attempt_at": "", "extn": "20001", "email": "", "vm_password": "", "domain": "192.168.31.98", "id": 57, "last_login_at": "", "name": "20001", "sha1": "\\x4688e7b8ba6...565fb4494b", "tel_enabled": 0, "auto_record": 0, "extn_id": 57, "deleted_at": "", "agent_info": { "agent_type": "callback", "busy_delay_time": "10", "status": "On Break", "lag": "2", "simo": "1", "no_answer_delay_time": "30", "reject_delay_time": "10", "member_wait": "nowait", "max_no_answer": "3", "wrap_up_time": "10" }, "type": "AGENT", "is_super": 0, "is_locked": false } ], "code": 200, "message": "success" }
查询坐席
- 请求 URL:
/api/users/$id
返回指定 ID 的坐席 - 请求 URL:
/api/users
返回所有坐席 - 请求方式:
GET
- 返回值: 用户对象,如果找不到会返回 HTTP 状态码
404
返回值 | 结果 |
---|---|
JSON 字符串 | 成功 |
404 | 失败 |
curl
示例:
curl -H "X-XTRA-AUTH-ID:850a23ad-786e-467d-bce1-7067ddaa14b2" 192.168.0.122:8081/api/users/37
- 示例:
GET /api/users/37
返回:
{ "context": "context-1", "id": 37, "deleted_at": "", "type": "AGENT", "ha1": "8326xxx...6028", "agent_type": "callback", "is_locked": false, "domain": "192.168.0.122", "no_answer_delay_time": "30", "wrap_up_time": "10", "ha1b": "f29xxxx...177", "cid_number": "", "idle_timeout": 2, "max_no_answer": "3", "login_attempts": 0, "last_login_at": "2023-01-07 11:31:26", "last_login_attempt_at": "", "extn": "1006", "disabled": 0, "status": "On Break", "first_login": 0, "member_wait": "nowait", "created_at": "2020-08-18 10:59:45", "reject_delay_time": "10", "cid_name": "", "weblogin_disabled": 0, "vm_password": "", "is_super": 1, "name": "mariah", "updated_at": "2023-05-28 17:47:10", "login": "1006", "salt": "xxx", "email": "", "auto_record": 0, "simo": "1", "busy_delay_time": "10", "lag": "2", "tel_enabled": 0, "tel": "" }
GET /api/users
返回:
{ "data": [ { "login": "system", "context": "", "ha1": "", "email": "", "auto_record": 0, "cid_name": "", "extn": "", "type": "", "updated_at": "2022-05-13 15:08:38", "deleted_at": "", "extn_id": 0, "cid_number": "", "created_at": "2022-05-13 15:08:37", "vm_password": "", "last_login_at": "", "is_super": 0, "tel_enabled": 0, "domain": "test.xswitch.cn", "id": 0, "ha1b": "", "name": "SYSTEM", "tel": "" }, { "login": "admin", "context": "context-1", "ha1": "fd4xxx...ac59", "email": "", "auto_record": 0, "cid_name": "", "extn": "admin", "type": "", "updated_at": "2022-05-13 16:36:31", "deleted_at": "", "extn_id": 0, "cid_number": "", "created_at": "2022-05-13 15:08:37", "vm_password": "", "last_login_at": "2022-05-13 16:36:31", "is_super": 1, "tel_enabled": 0, "domain": "test.xswitch.cn", "id": 1, "ha1b": "747exxx...66", "name": "Admin", "tel": "" } ], "page": 1, "rowCount": 2, "pageCount": 1 }
查询坐席下的分机
- 请求 URL:
/api/users/$id/extensions
返回指定 ID 的坐席下的分机信息 - 请求方式:
GET
- 返回值: 用户对象,如果找不到会返回空
返回值 | 结果 |
---|---|
json 字符串 | 成功 |
没有分机 |
- curl 示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/users/2/extensions
- 示例:
GET /api/users/2/extensions
返回:
[ { "ringback": "", "user_id": 2, "eavesdropped": 1, "cid_name": "", "type": "SIP", "auto_record": 0, "timeout": "", "created_at": "2020-08-18 10:59:45", "sync_enabled": 0, "enable_ringback": 0, "eavesdrop": 0, "vm_password": "", "intercepted": 2, "extn": "1007", "call_limit": 1, "connect_phone": "", "hotline_type": "", "caller_display": 1, "secretary_extn": "", "password": "", "cid_number": "", "enable_hotline": 0, "boss_extn": false, "hotline_address": "", "called_limit": 1, "enable_cb_onbusy": 0, "voicemail": 0, "extn_cidr": "", "group_name": "", "mac_address": "", "disabled": 0, "updated_at": "2023-11-08 17:12:35", "hotline_number": "", "forced_breakdown": 1, "forced_insert": 1, "codec": "", "force_breakdown": 0, "context": "context-1", "force_insert": 0, "domain": "test.xswitch.cn", "deleted_at": "", "default_extn_disabled": 0, "name": "mariah", "description": "", "call_transfer_type": 0, "intercept": 0, "weblogin_disabled": 0, "ha1b": "f29xxx...177", "call_authority": 4, "display_order": "0", "ha1": "832xxxx...028", "intercepted_group_name": "", "priority": "99", "id": 142 } ]
查询坐席下的队列
请求 URL:
/api/users/$id/queue/name
返回指定 ID 的坐席下的队列信息请求方式:
GET
返回值: 用户对象,如果找不到会返回空
curl 示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/users/2/queue/name
- 示例:
GET /api/users/2/queue/name
坐席绑定了队列时返回:
[ { "name": "queue1" }, { "name": "queue2" } ]
坐席没有绑定队列时返回空:
[]
修改某个坐席
- 请求 URL:
/api/users/$id
- 请求方式:
PUT
- 消息头:
Content-Type: application/json
- Body 信息: 参见用户信息说明
- 返回值: 对象,包含被修改的用户的 ID,如:
{"id": "3"}
- 示例:
PUT http://192.168.1.100:8081/api/users/3
Body:
{ "auto_record": "0", "context": "default", "domain": "xswitch.cn", "hardware_phone_only": "false", "name": "zhangsan", "vm_password": "5555", "lag": "2", "simo": "1", "status": "On Break", "agent_type": "callback", "member_wait": "nowait", "wrap_up_time": "10", "max_no_answer": "30", "busy_delay_time": "60", "reject_delay_time": "10" }
- curl 示例:
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \ -H "Content-Type: application/json" \ -d '{"auto_record":"0","context":"default","domain":"xswitch.cn","hardware_phone_only":"false","login":"20000","name":"lisi","vm_password":"5555","lag": "2", "simo": "1","status": "On Break","agent_type": "callback","member_wait": "nowait","wrap_up_time": "10","max_no_answer": "30","busy_delay_time": "60","reject_delay_time": "10"}' \ 192.168.1.100:8081/api/users/3
返回:
{ "data": "3", "code": 200, "message": "success" }
- 其他说明:
如果在请求参数中包含用户的 ID,则会被忽略(ID创建的时候就已固定,不能被修改)
修改密码
- 请求 URL:
/api/users/change_password
- 请求方式:
PUT
- 消息头:
Content-Type: application/json
- Body 信息: 参见用户信息说明
- 返回值:
status 200 OK
- 示例:
PUT http://192.168.1.100:8081/api/users/change_password
Body:
{ "old_password": "$VeryGoodPassw0rd", "password": "$VeryGoodPassw0rd-v2", "id": "3" }
- curl 示例:
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \ -H "Content-Type: application/json" \ -d '{"id":"3","old_password": "X1234!@#$","password":"$VeryGoodPassw0rd-v2"}' \ 192.168.1.100:8081/api/users/change_password
返回:
{ "data": "{}", "code": 200, "message": "success" }
- 其他说明:
当以admin用户权限去修改密码时,不再去校验old_password
,而是直接修改密码。非admin用户将进行校验old_password
。
删除坐席
- 请求 URL:
/api/users/$id
- 请求方式:
DELETE
- 消息头: 无
- 返回值: 对象,包含被删除用户的 ID,如
{"id": "3"}
- 示例:
DELETE http://192.168.1.100:8081/api/users/3
- curl 示例:
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE "192.168.1.100:8081/api/users/3"
返回:
{ "code": 200, "message": "success", "data": "3" }
队列
队列信息说明如下:
参数 | 说明 |
---|---|
name | 名字 |
description | 描述 |
moh_sound | 进入队列等待音 |
strategy | 策略 |
template | 创建时使用的模版 |
type | 种类(callcenter 或 fifo) |
greeting | 欢迎音 |
队列参数信息说明如下:
参数 | 说明 |
---|---|
realm | 域(CC 或 FIFO) |
k | 扩展参数名称 |
v | 扩展参数值 |
ref_id | 关联队列的id |
disabled | 是否启用。默认值为 0,0 为启用,1 为不启用 |
队列策略参数值中英文信息说明:
策略英文 | 中文说明 |
---|---|
ring-all | 所有坐席振铃 |
longest-idle-agent | 空闲时长最长振铃 |
top-down | 顺序振铃 |
agent-with-least-talk-time | 通话时长最小振铃 |
agent-with-fewest-calls | 接听最少振铃 |
sequentially-by-agent-order | 优先级振铃 |
round-robin | 轮循振铃 |
random | 随机 |
ring-progressively | 顺序振铃,之前已接听的坐席优先分配原客户 |
队列扩展参数值中英文信息说明(所有参数值类型均为字符串,个别填写参考如下):
CC 扩展参数英文 | 中文说明 | 值 |
---|---|---|
announce-sound | 播报声音文件 | string |
announce-frequency | 播报间隔时间 | string |
announce-agent-answer | 播报工号 | true/false |
announce-position | 播报位置 | string |
retain-agent | 最小空闲坐席数 | string |
wait-timeout | 最大等待时间 | string |
wait-timeout-without-agent | 无坐席最大等待时间 | string |
wait-timeout-without-agent-time-reached | 无坐席额外等待时间 | string |
overflow-capacity-action | 排队溢出操作 | 挂断{"action":"hangup"} 或转接{"action":"transfer","data":"1001"} |
wait-timeout-without-agent-action | 无坐席超时操作 | 挂断{"action":"hangup"} 或转接{"action":"transfer","data":"1001"} |
wait-timeout-action | 超时操作 | 挂断{"action":"hangup"} 或转接{"action":"transfer","data":"1001"} |
tier-rules-apply | 应用阶层规则 | string |
tier-rule-wait-second | 进入下一阶层等待时长 | string |
tier-rule-wait-multiply-level | 阶层等待倍增等级 | string |
tier-rule-no-agent-no-wait | 无坐席无等待阶层规则 | string |
abandoned-resume-allowed | 是否放弃之前等待时间 | string |
discard-abandoned-after | 删除之前等待时间 | string |
time-base-score | 时间基准分数 | string |
capacity | 容量 | string |
agent-timeout | 坐席超时时间 | string |
FIFO 扩展参数英文 | 中文说明 | 值 |
---|---|---|
importance | 重要等级 | int |
outbound_per_cycle | 坐席群振数量 | int |
outbound_per_cycle_min | 坐席最小群振数量 | int |
outbound_priority | 优先级 | int |
outbound_name | 外呼显示名 | int |
retry_delay | 重拨延时 | int |
outbound_ring_timeout | 响铃时间 | int |
outbound_default_lag | 默认延迟 | int |
获取已存在队列
- 请求 URL:
/api/queues
- 请求方式:
GET
- Body 信息:无
- curl 示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/queues
- 返回值:返回现有全部队列的信息。内容参考队列信息说明。
{ "page": 1, "pageCount": 1, "data": [ { "outbound_default_lag": "30", "description": "", "id": "1", "load_url": "", "deleted_at": "", "strategy": "ringall", "created_at": "2023-03-03 09:07:08", "outbound_per_cycle": "1", "load_url_params": "{}", "outbound_per_cycle_min": "1", "importance": "0", "outbound_ring_timeout": "60", "outbound_priority": "5", "cti_template": "fifo", "greeting": "", "auto_record": "0", "moh_sound": { "media_path": "phrase:welcome@xui", "media_type": "SYSTEM", "media_id": "204" }, "updated_at": "2023-03-03 09:07:08", "name": "FIFO1" },{ "updated_at": "2023-04-18 10:10:46", "cti_template": "callcenter", "created_at": "2022-11-09 13:15:34", "tier-rule-no-agent-no-wait": "false", "max-wait-time-with-no-agent-time-reached": "5", "abandoned-resume-allowed": "false", "description": "", "tier-rule-wait-second": "300", "discard-abandoned-after": "60", "max-wait-time": "0", "tier-rule-wait-multiply-level": "true", "id": "63", "tier-rules-apply": "false", "max-wait-time-with-no-agent": "0", "greeting": { "media_path": "tone_stream://%(400,200,383,417);%(400,2000,383,417)", "media_id": 41, "media_type": "RINGTONE" }, ... ], "rowCount": 15, "pageCount": 1, "page": 1 }
获取已签入的坐席
- 请求 URL:
/api/queues/agents
- 请求方式:
GET
- Body 信息:无
- curl 示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.31.98:9081/api/queues/agents
- 返回值:返回当前每个队列中为签入状态的坐席信息(但不一定坐席为示闲状态)。内容参考坐席信息说明。
[ { "member_wait": "nowait", "no_answer_delay_time": "0", "lag": "2", "id": "6", "hardware_phone_only": "false", "agent_id": "6", "deleted_at": "", "queue_name": "111", "domain": "192.168.31.98", "agent_type": "callback", "level": "1", "external_queue_id": "", "external_agent_id": "", "status": "On Break", "description": "", "position": "1", "name": "1004", "extn": "1004", "updated_at": "2023-09-22 08:46:35", "max_no_answer": "0", "cti_template": "callcenter", "reject_delay_time": "0", "busy_delay_time": "0", "wrap_up_time": "10", "agent_name_md5": "fed33392d3a48aa149a87a38b875ba4a", "queue_id": "1", "simo": "1", "timeout": "15", "agent_name": "1004", "created_at": "2023-09-22 08:46:35", "disabled": "1" }, { "level": "1", "no_answer_delay_time": "30", "lag": "2", "id": "7", "status": "On Break", "agent_id": "12", "deleted_at": "", "queue_name": "111", "reject_delay_time": "10", "busy_delay_time": "10", "agent_type": "callback", "wrap_up_time": "10", "external_queue_id": "", "external_agent_id": "", "queue_id": "1", "description": "", "domain": "192.168.31.98", "name": "1010", "agent_name": "1010", "updated_at": "2023-12-21 16:14:06", "max_no_answer": "3", "cti_template": "callcenter", "member_wait": "nowait", "agent_name_md5": "1e48c4420b7073bc11916c6c1de226bb", "simo": "1", "extn": "1010", "position": "1", "created_at": "2023-12-21 16:14:06", "disabled": "1" }, { "member_wait": "nowait", "no_answer_delay_time": "30", "lag": "2", "id": "8", "hardware_phone_only": "false", "agent_id": "2", "deleted_at": "", "queue_name": "111", "domain": "192.168.31.98", "agent_type": "callback", "level": "1", "external_queue_id": "", "external_agent_id": "", "status": "On Break", "description": "", "position": "1", "name": "1000", "extn": "1000", "updated_at": "2024-02-05 07:15:31", "max_no_answer": "0", "cti_template": "callcenter", "reject_delay_time": "0", "busy_delay_time": "10", "wrap_up_time": "0", "agent_name_md5": "a9b7ba70783b617e9998dc4dd82eb3c5", "queue_id": "1", "simo": "1", "timeout": "15", "agent_name": "1000", "created_at": "2024-02-05 07:15:31", "disabled": "1" }, { "level": "1", "no_answer_delay_time": "30", "lag": "2", "id": "11", "status": "On Break", "agent_id": "13", "deleted_at": "", "queue_name": "111", "reject_delay_time": "10", "busy_delay_time": "10", "agent_type": "callback", "wrap_up_time": "10", "external_queue_id": "", "external_agent_id": "", "queue_id": "1", "description": "", "domain": "192.168.31.98", "name": "1011", "agent_name": "1011", "updated_at": "2024-04-22 14:29:55", "max_no_answer": "3", "cti_template": "callcenter", "member_wait": "nowait", "agent_name_md5": "7f975a56c761db6506eca0b37ce6ec87", "simo": "1", "extn": "1011", "position": "1", "created_at": "2024-04-22 14:29:55", "disabled": "1" }, { "level": "1", "no_answer_delay_time": "30", "lag": "2", "id": "13", "status": "On Break", "agent_id": "27", "deleted_at": "", "queue_name": "2222", "reject_delay_time": "10", "busy_delay_time": "10", "agent_type": "callback", "wrap_up_time": "10", "external_queue_id": "", "external_agent_id": "", "queue_id": "3", "description": "", "domain": "192.168.1.251", "name": "10000", "agent_name": "10000", "updated_at": "2024-05-28 02:32:17", "max_no_answer": "3", "cti_template": "callcenter", "member_wait": "nowait", "agent_name_md5": "b7a782741f667201b54880c925faec4b", "simo": "1", "extn": "10000", "position": "1", "created_at": "2024-05-28 02:32:17", "disabled": "1" } ]
查看某条队列的详细信息
- 请求 URL:
/api/queues/$id
- 请求方式:
GET
- Body 信息:无
- curl 示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "192.168.1.100:8081/api/queues/1"
- 返回值:返回指定某条队列的详细信息。内容参考队列信息说明。
{ "outbound_ring_timeout": "60", "load_url": "", "id": 1, "strategy": "ringall", "outbound_priority": "5", "outbound_per_cycle": "1", "outbound_default_lag": "30", "auto_record": 0, "created_at": "2023-03-03 09:07:08", "moh_sound": { "media_id": "204", "media_path": "phrase:welcome@xui", "media_type": "SYSTEM" }, "deleted_at": "", "outbound_per_cycle_min": "1", "description": "", "load_url_params": "{}", "updated_at": "2023-03-03 09:07:08", "importance": "0", "cti_template": "fifo", "greeting": "", "name": "FIFO1" }
查看某条队列下的坐席
- 请求 URL:
/api/queues/$id/agents
- 请求方式:
GET
- Body 信息:无
- curl 示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/queues/4/agents
- 返回值:返回指定队列中坐席的信息。
{ "pageCount": 1, "rowCount": 1, "page": 1, "data": [{ "status": "On Break", "disabled": "1", "id": "148", "max_no_answer": "30", "agent_type": "callback", "external_queue_id": "", "no_answer_delay_time": "30", "busy_delay_time": "60", "description": "", "reject_delay_time": "10", "name": "1007", "deleted_at": "", "wrap_up_time": "10", "queue_name": "queue1", "external_agent_id": "", "hardware_phone_only": "false", "level": "1", "simo": "1", "agent_name_md5": "352407221afb776e3143e8a1a0577885", "position": "1", "member_wait": "nowait", "domain": "test.xswitch.cn", "lag": "2", "agent_id": "231", "extn": "1007", "updated_at": "2024-05-29 09:53:29", "agent_name": "1007", "created_at": "2024-05-29 09:53:29", "queue_id": "83" }] }
查看某条队列下剩余的坐席
- 请求 URL:
/api/queues/$id/remain_agents
- 请求方式:
GET
- Body 信息:无
- curl 示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.31.98:9081/api/queues/1/remain_agents
- 返回值:返回未签入到当前队列内的坐席信息。
[ { "name": "2000", "agent_id": "24", "agent_name_md5": "08f90c1a417155361a5c4b8d297e0d78", "agent_name": "2000", "domain": "192.168.31.98" }, { "name": "1019", "agent_id": "21", "agent_name_md5": "03e0704b5690a2dee1861dc3ad3316c9", "agent_name": "1019", "domain": "192.168.31.98" }, { "name": "10000", "agent_id": "27", "agent_name_md5": "b7a782741f667201b54880c925faec4b", "agent_name": "10000", "domain": "192.168.1.251" }, { "name": "20001", "agent_id": "57", "agent_name_md5": "2383c7d07bce3c82e6da7741782de416", "agent_name": "20001", "domain": "192.168.31.98" }, { "name": "20000", "agent_id": "56", "agent_name_md5": "d9798cdf31c02d86b8b81cc119d94836", "agent_name": "20000", "domain": "192.168.31.98" } ]
查看某条队列的扩展参数
- 请求 URL:
/api/queues/$id/extra_params
- 请求方式:
GET
- Body 信息:无
- curl 示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "192.168.1.100:8081/api/queues/1/extra_params"
- 返回值:返回指定队列中全部扩展参数信息。参考队列扩展参数值中英文信息说明。
[ { "ref_id": 1, "id": 4650, "updated_at": "2023-05-29 09:51:03", "created_at": "2023-05-29 09:51:03", "realm": "CC", "disabled": 0, "deleted_at": "", "v": "false", "k": "tier-rules-apply" }, { "ref_id": 1, "id": 4651, "updated_at": "2023-05-29 09:51:03", "created_at": "2023-05-29 09:51:03", "realm": "CC", "disabled": 0, "deleted_at": "", "v": "60", "k": "discard-abandoned-after" }, { "ref_id": 1, "id": 4652, "updated_at": "2023-05-29 09:51:03", "created_at": "2023-05-29 09:51:03", "realm": "CC", "disabled": 0, "deleted_at": "", "v": "300", "k": "tier-rule-wait-second" }, { "ref_id": 1, "id": 4653, "updated_at": "2023-05-29 09:51:03", "created_at": "2023-05-29 09:51:03", "realm": "CC", "disabled": 0, "deleted_at": "", "v": "false", "k": "abandoned-resume-allowed" }, ... ]
查看某条队列的排队人数
- 请求 URL:
/api/queues/members_count/$name
- 请求方式:
GET
- Body 信息:无
- curl 示例:
curl -H "X-XTRA-AUTH-ID: f35ef66b-99b6-48f0-b7c3-6a8ece92c390" "192.168.2.50:8081/api/queues/members_count/测试"
- 返回值:返回指定队列中当前排队人数。
{ "queue": "测试", "members_count": "1" }
新增队列
- 请求 URL:
/api/queues
- 请求方式:
POST
- 消息头:
Content-Type: application/json
- Body 信息: 参见队列信息说明
- 实例: Body:
{ "auto_record": "1", "description": "test", "moh_sound": 411, "name": "test2", "strategy": "agent-with-fewest-calls", "template": "default", "cti_template": "callcenter", "type": "callcenter" }
moh_sound
的值为媒体文件id,可通过【高级】⇨【扩展功能】⇨【媒体文件】查询所需使用的媒体文件id。
返回:
{ "code": 200, "data": "2", "message": "success" }
- curl 示例:
curl -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"auto_record": "1", "description": "test", "moh_sound": 411, "name": "test2", "strategy": "agent-with-fewest-calls", "template": "default", "cti_template": "callcenter", "type": "callcenter"}' \ -H "Content-Type: application/json" "http://192.168.1.100:8081/api/queues"
队列中添加坐席
- 请求 URL:
/api/queues/$id/agents
- 请求方式:
POST
- 消息头:
Content-Type: application/json
- Body 信息:
参数 | 说明 |
---|---|
agent_id | 坐席 ID |
agent_name | 坐席名称 |
- 实例: Body:
{ "agents": [ { "agent_id": "24", "agent_name": "1022" }, { "agent_id": "25", "agent_name": "1023" } ] }
返回:
{ "data": [ { "updated_at": "2022-05-16 09:00:00", "deleted_at": "", "queue_id": 2, "position": 1, "agent_id": 24, "disabled": 1, "external_queue_id": "", "domain": "", "extn": "1022", "level": 1, "external_agent_id": "", "queue_name": "ewrw", "description": "", "created_at": "2022-05-16 09:00:00", "id": 4, "agent_name": "1022" }, { "updated_at": "2022-05-16 09:00:00", "deleted_at": "", "queue_id": 2, "position": 1, "agent_id": 25, "disabled": 1, "external_queue_id": "", "domain": "", "extn": "1023", "level": 1, "external_agent_id": "", "queue_name": "ewrw", "description": "", "created_at": "2022-05-16 09:00:00", "id": 5, "agent_name": "1023" } ], "message": "success", "code": 200 }
- curl 示例:
curl -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"agents":[{"agent_id":"24", "agent_name": "1022"},{ "agent_id":"25", "agent_name": "1023"}]}' \ -H "Content-Type: application/json" "http://192.168.1.100:8081/api/queues/2/agents"
指定队列中移除指定坐席
在调用如下接口之前先将坐席从队列中签出
- 请求 URL:
/api/queues/$queue_id/agents/$agent_id
- 请求方式:
DELETE
- 消息头:
Content-Type: application/json
- Body 信息:
参数 | 说明 |
---|---|
agent_id | 坐席 ID |
queue_id | 所属队列 ID |
- curl 示例:
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/queues/2/agents/1
返回:
{ "code": 200, "message": "success", "data": "3" }
指定队列中移除多个坐席
在调用如下接口之前先将坐席从队列中签出
- 请求 URL:
/api/queues/$queue_id/agents/
- 请求方式:
DELETE
- 消息头:
Content-Type: application/json
- Body 信息:
参数 | 说明 |
---|---|
agent_id | 坐席 ID |
queue_id | 所属队列 ID |
- 实例:Body:
{ "agent_id": "12,13" }
- curl 示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"agent_id": "12,13"}' -XDELETE 192.168.1.100:8081/api/queues/2/agents
返回:
{ "data": { "agent_id": "12,13", "id": "1" }, "code": 200, "message": "success" }
查看所有扩展参数信息
- 请求 URL1:
/api/dicts/realm/QUEUE_CC_PARAM
查询 CC 参数 - 请求 URL2:
/api/dicts/realm/QUEUE_FIFO_PARAM
查询 FIFO 参数 - 请求方式:
GET
- Body 信息:无
- curl 示例:
// 查询CC参数 : curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "192.168.1.100:8081/api/dicts/realm/QUEUE_CC_PARAM" // 查询FIFO参数 : curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "192.168.1.100:8081/api/dicts/realm/QUEUE_FIFO_PARAM"
- 返回值:正常返回所有扩展参数信息。
// 查询CC参数 : [ { "d": "", "v": "announce-position", "o": "0", "k": "Announce Position", "id": "464", "deleted_at": "", "realm": "QUEUE_CC_PARAM", "created_at": "2022-05-13 15:08:36", "updated_at": "2022-05-13 15:08:36" }, ... ] // 查询FIFO参数 : [ { "d": "", "v": "importance", "created_at": "2023-03-03 02:46:42", "k": "Importance", "o": "0", "realm": "QUEUE_FIFO_PARAM", "deleted_at": "", "id": "501", "updated_at": "2023-03-03 02:46:42" }, ... ]
新增指定队列的指定扩展参数
- 请求 URL:
/api/queues/$id/extra_params
- 请求方式:
POST
- 消息头:
Content-Type: application/json
- Body 信息:
字段 | 必选 | 类型 | 备注 |
---|---|---|---|
k | 是 | string | 参数名称,如需新增指定扩展参数,请从上面查询出的所有扩展参数内进行选择添加。 |
v | 是 | string | 参数值 |
realm | 是 | string | realm 类型,callcenter 为"CC", fifo 为"FIFO" |
- 实例一:
Body:
{ "realm": "CC", "k": "announce-sound", "v": "1" }
- 实例二:
Body:
{ "realm": "CC", "k": "overflow-capacity-action", "v": "{\"action\":\"transfer\",\"data\":\"1009\"}" }
- 实例三:
Body:
{ "realm": "FIFO", "k": "importance", "v": 0 }
- 返回值:参数 ID
{ "data": 114, "code": 200, "message": "success" }
- curl 示例:
curl -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"realm": "CC", "k": "announce-sound", "v": "1" }' \ -H "Content-Type: application/json" "http://192.168.1.100:8081/api/queues/2/extra_params"
修改指定队列信息
- 请求 URL:
/api/queues/$id
- 请求方式:
PUT
- 消息头:
Content-Type: application/json
- Body 信息: 参见队列信息说明
- 实例 : Body:
{ "auto_record": "1", "description": "test", "greeting": "{\"media_path\":\"phrase:welcome@xui\"}", "moh_sound": "{\"media_path\":\"phrase:welcome@xui\"}", "strategy": "longest-idle-agent" }
返回 :
{ "code": 200, "message": "success", "data": "1" }
- curl 示例:
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \ -H "Content-Type: application/json" \ -d '{ "auto_record": "1", "description": "test", "greeting": "{\"media_path\":\"phrase:welcome@xui\"}", "moh_sound": "{\"media_path\":\"phrase:welcome@xui\"}", "strategy": "longest-idle-agent"}' \ "192.168.1.100:8081/api/queues/1"
修改指定队列的扩展参数
请求 URL:
/api/queues/$id/extra_params/$extra_params
请求参数 说明 :id 队列 id :extra_params 扩展参数 id 请求方式:
PUT
消息头:
Content-Type: application/json
Body 信息: 参见队列扩展参数信息说明
实例一 :
Body :
{ "v": "600", "k": "discard-abandoned-after" }
- 实例二 :
Body :
{ "v": "true", "k": "abandoned-resume-allowed" }
- curl 示例:
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \ -H "Content-Type: application/json" \ -d '{"v":"true","k":"abandoned-resume-allowed"}' \ "http://192.168.1.100:8081/api/queues/39/extra_params/100"
返回 :
{ "message": "success", "data": "39", "code": 200 }
开启/关闭指定队列指定扩展参数
请求 URL:
/api/queues/$id/extra_params/$extra_params
请求参数 说明 :id 队列 id :extra_params 扩展参数 id 请求方式:
PUT
消息头:
Content-Type: application/json
Body 信息:
参数 说明 action 变更启用状态,固定为"toggle" 实例 : Body :
{ "action": "toggle" }
- curl 示例:
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \ -H "Content-Type: application/json" \ -d '{"action": "toggle"}' \ "http://192.168.1.100:8081/api/queues/2/extra_params/28"
返回 :
{ "code": 200, "message": "success", "data": "28" }
删除指定队列
- 请求 URL:
/api/queues/$id
- 请求方式:
DELETE
- 消息头:无
- curl 示例:
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/queues/2
- 返回(示例):
{ "code": 200, "data": "2", "message": "success" }
删除指定队列的指定扩展参数
- 请求 URL:
/api/queues/$id/extra_params/$extra_params
- 请求方式:
DELETE
- 消息头:无
- curl 示例:
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/queues/39/extra_params/100
- 返回(示例):
{ "code": 200, "message": "success", "data": "39" }
坐席呼叫相关
参数介绍
agent: 坐席的工号,如 10001,如果有对应的组,则是<组名>.<工号>,如 default.10001
extn: 分机号
queue: 队列名称
destNumber: 被叫号码
callUUID: 呼入 UUID
destUUID: 呼出 UUID
destAgent: 被叫坐席
destExtn: 被叫分机
vars: 坐席呼叫字符串参数
获取坐席状态
根据队列名称及类型获取该队列下坐席状态,例如,查询队列名test
并且类型为callcenter
下的所有坐席状态。
请求 URL:
/api/cc/agent_state?queue=test&type=callcenter
请求方式:
GET
返回(示例):
[ { "callstate": "IDLE", "group_id": "default", "queue_id": "test", "agent_uuid": "", "state": "READY", "agent_id": "1020", "extn": "1020" } ]
坐席签入
- 请求 URL:
/api/cc/ccc/ccLogin
- 请求方式:
POST
请求 JSON 内容格式如下:
{ "agent": "1022", "extn": "1022", "queue": "welcome_queue_example" }
签入示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"agent":"1022","extn": "1022","queue": "welcome_queue_example"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccLogin"
坐席签出
- 请求 URL:
/api/cc/ccc/ccLogout
- 请求方式:
POST
请求 JSON 内容格式如下:
{ "agent": "1022", "queue": "welcome_queue_example" }
签出示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"agent":"1022","queue": "welcome_queue_example"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccLogout"
成功返回如下
{ "message": "success", "code": 200 }
坐席示闲
- 请求 URL:
/api/cc/ccc/ccGoReady
- 请求方式:
POST
请求 JSON 内容格式如下:
{ "agent": "1022", "queue": "welcome_queue_example" }
示闲示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"agent":"1022","queue": "welcome_queue_example"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccGoReady"
成功返回如下
{ "message": "success", "code": 200 }
坐席示忙
- 请求 URL:
/api/cc/ccc/ccGoBreak
- 请求方式:
POST
请求 JSON 内容格式如下:
{ "agent": "1002", "reason": "have lanch", "queue": "welcome_queue_example" }
示忙请求示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"agent":"1002","reason":"have lanch","queue": "welcome_queue_example"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccGoBreak"
成功返回如下
{ "message": "success", "code": 200 }
坐席外呼
- 请求 URL:
/api/cc/ccc/ccDial
- 请求方式:
POST
外呼请求 JSON 内容格式如下:
{ "agent": "1006", "extn": "1006", "destNumber": "15666xx1111" }
示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"agent":"1006","extn":"1006","destNumber":"15666xx1111"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccDial"
坐席未签入返回如下
{ "message": "can not find group?", "code": 500 }
已呼出如下
{ "message": "success", "code": 200 }
坐席应答
- 请求 URL:
/api/cc/ccc/ccAnswer
- 请求方式:
POST
请求 JSON 内容格式如下:
{ "destUUID": "qqwwszztxxxxxxxxxxx" }
应答示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"destUUID" = "qqwwszztxxxxxxxxxxx"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccAnswer"
注意,此功能需坐席SIP话机支持自动应答功能方可生效。若坐席为WebRTC类型,则无法使用此功能
坐席挂机
- 请求 URL:
/api/cc/ccc/ccKill
- 请求方式:
POST
请求 JSON 内容格式如下:
{ "destUUID": "qqwwszztxxxxxxxxxxx" }
挂机示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"destUUID" = "qqwwszztxxxxxxxxxxx"}' \ -H "Content-Type: application/json" 192.168.1.100:8081/api/cc/ccc/ccKill
成功返回如下
{ "message": "success", "code": 200 }
坐席呼叫保持
- 请求 URL:
/api/cc/ccc/ccHold
- 请求方式:
POST
请求 JSON 内容格式如下:
{ "callID": "qqwwszztxxxxxxxxxxx" }
保持示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"callID" = "qqwwszztxxxxxxxxxxx"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccHold"
取消保持示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"callID" = "qqwwszztxxxxxxxxxxx"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccUnHold"
成功返回如下
{ "message": "success", "code": 200 }
坐席转接
- 请求 URL:
/api/cc/ccc/ccTransfer
- 请求方式:
POST
转接请求 JSON 内容格式如下:
{ "callID": "f2e15a60-4fc1-494a-823c-55bbca71b4a6", "destNumber": "1009" }
转接示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"callID":"f2e15a60-4fc1-494a-823c-55bbca71b4a6","destNumber":"1009"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccTransfer"
三方通话
- 请求 URL:
/api/cc/ccc/ccThreeWay
- 请求方式:
POST
邀请分机
JSON 内容格式如下:
{ "destAgent": "1009", "destExtn": "1009", "callID": "f2e15a60-4fc1-494a-823c-55bbca71b4a6", "agent": "2000" }
邀请外部号码
请求 JSON 内容格式如下:
{ "destAgent": "PSTN", "destExtn": "1566609xxxx", "callID": "f2e15a60-4fc1-494a-823c-55bbca71b4a6", "agent": "2000" }
三方通话示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"destAgent":"1009","destExtn":"1009","callID":"f2e15a60-4fc1-494a-823c-55bbca71b4a6","agent": "2000"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccThreeWay"
成功返回如下
{ "message": "success", "code": 200 }
坐席监听
- 请求 URL:
/api/cc/ccc/ccMonitor
- 请求方式:
POST
坐席 A 和客户 B 通话中,坐席 C 调用接口监听该通话(坐席 C 必须是签入状态)。
- agent:坐席 C 的工号,如 1003
- extn:坐席 C 的分机号,如 1003
- destAgent:坐席 A 的工号,如 1002
- destUUID:需要监听通话的
channel UUID
请求 JSON 内容格式如下:
{ "destAgent": "1002", "destUUID": "e2e15a60-4fc1-494a-823c-55bbca71b4c6", "agent": "1003", "extn": "1003" }
示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"destAgent":"1002","destUUID":"e2e15a60-4fc1-494a-823c-55bbca71b4c6","agent":"1003","extn":"1003"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccMonitor"
成功返回如下
{ "code": 200, "message": "success" }
邀请外部号码监听
- 请求 URL:
/api/cc/ccc/ccMonitor
- 请求方式:
POST
坐席 A 和客户 B 通话中,调用接口邀请外部号码并监听该通话。
- agent:PSTN
- extn:外部号码,如 131xxxxxxxx
- destAgent:坐席 A 的工号,如 1002
- destUUID:需要监听通话的
channel UUID
请求 JSON 内容格式如下:
{ "destAgent": "1002", "destUUID": "e2e15a60-4fc1-494a-823c-55bbca71b4c6", "agent": "PSTN", "extn": "131xxxxxxxx" }
示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"destAgent":"1002","destUUID":"e2e15a60-4fc1-494a-823c-55bbca71b4c6","agent":"PSTN","extn":"131xxxxxxxx"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccMonitor"
成功返回如下
{ "code": 200, "message": "success" }
坐席强插
- 请求 URL:
/api/cc/ccc/ccIntercept
- 请求方式:
POST
坐席 A 和客户 B 通话中,坐席 C 调用接口直接与客户 B 通话,坐席 A 挂断。
- agent:坐席 C 的工号,如 1003
- extn:坐席 C 的分机号,如 1003
- destAgent:坐席 A 的工号,如 1002
- destUUID:需要强插通话的
channel UUID
请求 JSON 内容格式如下:
{ "destAgent": "1002", "destUUID": "e2e15a60-4fc1-494a-823c-55bbca71b4c6", "agent": "1003", "extn": "1003" }
示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"destAgent":"1002","destUUID":"e2e15a60-4fc1-494a-823c-55bbca71b4c6","agent":"1003","extn":"1003"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccIntercept"
成功返回如下
{ "code": 200, "message": "success" }
外部号码强插
- 请求 URL:
/api/cc/ccc/ccIntercept
- 请求方式:
POST
坐席 A 和客户 B 通话中,调用接口实现外部号码 C 直接与客户 B 通话,坐席 A 挂断。
- agent:PSTN
- extn:外部号码 C 的号码,如 131xxxxxxxx
- destAgent:坐席 A 的工号,如 1002
- destUUID:需要强插通话的
channel UUID
请求 JSON 内容格式如下:
{ "destAgent": "1002", "destUUID": "e2e15a60-4fc1-494a-823c-55bbca71b4c6", "agent": "PSTN", "extn": "131xxxxxxxx" }
示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"destAgent":"1002","destUUID":"e2e15a60-4fc1-494a-823c-55bbca71b4c6","agent":"PSTN","extn":"131xxxxxxxx"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccIntercept"
成功返回如下
{ "code": 200, "message": "success" }
咨询转
- 请求 URL:
/api/cc/ccc/ccConsult
- 请求方式:
POST
坐席 A 和客户 B 通话中,调用此接口客户 B 处于播放等待音乐,此时坐席 A 与坐席 C 通话,咨询是否方便通话,方便则坐席 A 挂断,坐席 C 直接与客户 B 通话,不方便坐席 C 挂断,则坐席 A 继续与客户 B 通话。
- agent:坐席 A 的工号,如 1002;如果咨询外线,则设置为 PSTN
- destExtn:坐席 C 的分机号,如 1003,如果为咨询外线,则设置外部号码,比如 131xxxxxxxx
- destAgent:坐席 C 的工号,如 1003
- callID:坐席 A 通话的
channel UUID
咨询坐席 C 请求 JSON 内容格式如下:
{ "destAgent": "1003", "callID": "f2f30dc1-b4ff-48d6-b016-32469e537226", "agent": "1002", "destExtn": "1003" }
咨询外线号码请求 JSON 内容格式如下:
{ "destAgent": "1003", "callID": "f2f30dc1-b4ff-48d6-b016-32469e537226", "agent": "PSTN", "destExtn": "131xxxxxxxx" }
示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"destAgent":"1003","callID":"e2e15a60-4fc1-494a-823c-55bbca71b4c6","agent":"1002","destExtn":"1003"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccConsult"
成功返回如下
{ "code": 200, "message": "success" }
取消咨询转
- 请求 URL:
/api/cc/ccc/ccCancelConsult
- 请求方式:
POST
坐席 A 和客户 B 通话中,调用此接口客户 B 处于播放等待音乐,此时坐席 A 与坐席 C 通话,咨询是否方便通话。调用此接口则表示不方便通话,坐席 A 继续与客户通话。
- callID:坐席 A 通话的
channel UUID
请求 JSON 内容格式如下:
{ "callID": "f2f30dc1-b4ff-48d6-b016-32469e537226" }
示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \ -d '{"callID":"e2e15a60-4fc1-494a-823c-55bbca71b4c6"}' \ -H "Content-Type: application/json" "192.168.1.100:8081/api/cc/ccc/ccCancelConsult"
成功返回如下
{ "code": 200, "message": "success" }
前端接口
前端电话条接口 Demo 见callcenter。