质检管理

优质
小牛编辑
118浏览
2023-12-01

1、接口声明

在调用接口时必须在https请求的header中携带"token"参数。

token是智齿客服接口开放平台全局唯一的接口调用凭据。
开发者在调用各业务接口时都需使用token,开发者需要进行妥善保存。token的存储至少要保留32个字符空间。token的有效期目前为24个小时,需定时刷新,或根据接口返回的token失效提示,进行重新获取。请求token接口,无论token是否存在,都会返回新的token,并重置token的过期时间(目前24小时)。

token使用方式说明:
1、开发者需要统一获取和管理token,在调用智齿客服各个业务开放接 口时都应该使用同一个的token,不应该每个业务都刷新获取新的 token,否则容易导致token失效,影响接口的正常调用;
2、目前token的有效期通过返回的expire_in来传达,目前是86400 秒之内的值。开发者需要根据这个有效时间提前去刷新新token。
3、开发者需要根据接口返回的token失效提示,进行重新获取token。

2、接口调用

2.1、获取访问token编码

接口说明:

获取API开放接口token,此token仅适用于智齿开放平台 5.0版本全部API接口 。API接口中的参数 appid, app_key 请联系智齿售后人员获取。

请求方式:

GET

请求地址:

https://www.sobot.com/api/get_token

请求参数:

参数类型必填名称备注
appidString接口凭证Id第三方用户接口调用唯一凭证id
create_timeString时间戳时间戳,秒,例如 2019-09-25 15:49:33 的时间戳1569397773
signString签名md5(appid+create_time+app_key) sign签名,app_key为密钥

返回参数:

参数类型必填名称
ret_codeString返回编码
ret_msgString返回信息
itemObject返回对象

item对象:

参数类型必填名称备注
tokenStringtoken编码
expires_inString凭证有效时间单位:秒

时间戳转换参考工具:

http://tool.chinaz.com/Tools/unixtime.aspx

sign签名生成示例:

例如,appid = "1"; create_time="1569397773"; app_key="2"

sign = Md5("115693977732") 为 258eec3118705112b2c53dc8043d4d34。

请求示例:

curl https://www.sobot.com/api/get_token?appid=1&create_time=1569397773&sign=258eec3118705112b2c53dc8043d4d34

返回示例:

{
    "item": {
        "token": "4ac37cb2e9c740dba4b75a34d5358802",
        "expires_in": "86400"
    },
    "ret_code": "000000",
    "ret_msg": "操作成功"
}

2.2、获取呼叫质检结果

接口说明:

获取系统中呼叫质检结果信息

请求方式:

GET

请求地址:

https://www.sobot.com/api/interceptor/5/quality/call_result

请求参数:

参数类型必填名称备注
start_datetimeString开始时间示例:2018-07-10 00:00:00
end_datetimeString结束时间示例: 2018-07-10 00:00:00
page_noInteger起始页
page_sizeInteger每页显示条数默认每页15条

返回参数:

参数类型必填名称备注
ret_codeString返回编码
ret_msgString返回信息
itemsList对象列表
page_countInteger共几页
page_noInteger起始页
page_sizeInteger每页条数每页展示的条数
total_countInteger数据条数总共的数据条数

items对象

参数类型必填名称备注
agentidString坐席id
agent_nameString坐席名称
agent_emailString坐席邮箱
call_start_datetimeString通话开始时间
call_log_jestidString通话id
quality_datetimeString质检时间
total_score_maxString质检满分
standard_score_maxString质检标准分满分
pulse_maxString质检加分项满分
minus_maxString质检减分项满分
total_scoreString质检得分
standard_scoreString质检标准分得分
pulseString质检加分项得分
minusString质检减分项得分

请求示例:

curl -H 'token:4ac37cb2e9c740dba4b75a34d5358802' https://www.sobot.com/api/interceptor/5/quality/call_result?start_datetime=2019-10-22 00:00:00&end_datetime=2019-11-10 00:00:00&page_no=1&page_size=15

返回示例:

{
    "items": [
        {
            "standard_score_max": "123.5",
            "pulse_max": "22.0",
            "minus": "0.0",
            "agent_email": "132@sobot.com",
            "qualify_time": "1554971786077",
            "call_start_datetime": "1553594283000",
            "agent_name": "testxx",
            "total_score": "132",
            "call_log_jestid": "b212d432-ea8f-4701-9637-d01c8a5d9945",
            "total_score_max": "11.0",
            "pulse": "122.0",
            "agentid": "2856580f156a4f9ea73dd4e9ac86896e",
            "standard_score": "10.0",
            "minus_max": "33.0"
        }],
    "page_count": 1,
    "page_no": 1,
    "page_size": 15,
    "ret_code": "000000",
    "ret_msg": "操作成功",
    "total_count": 1
}

2.3、获取在线质检结果

接口说明

接口类型:主动调用接口。

接口作用:获取在线质检结果

请求方式:

GET

请求地址:

https://www.sobot.com/api/interceptor/5/quality/chat_result

请求参数:

参数类型必填名称备注
start_datetimeString开始日期示例:2018-07-10
end_datetimeString结束日期示例:2018-07-10
page_noInteger当前页码
page_sizeInteger每页条数(默认100,最大可传入10000)

返回参数:

参数类型必填名称备注
ret_codeString返回编码
ret_msgString返回信息
itemsList返回对象

items对象:

参数类型名称备注
chat_start_datetimeString会话开始时间(毫秒)
update_datetimeString质检时间
schemeidString质检方案id
total_scoreString质检方案满分
standard_total_scoreString质检标准分满分
add_total_scoreString质检加分项满分
minus_total_scoreString质检减分项满分
quality_scoreString质检得分
standard_quality_scoreString质检标准分得分
add_quality_scoreString质检加分项得分
minus_quality_scoreString质检减分项得分
agentidString坐席id
agent_nameString坐席姓名
agent_emailString坐席邮箱
cidString会话id

请求示例:

curl -H 'token:4ac37cb2e9c740dba4b75a34d5358802' https://www.sobot.com/api/interceptor/5/quality/chat_result?start_datetime=2019-10-22 00:00:00&end_datetime=2019-11-10 00:00:00&page_no=1&page_size=15

返回示例:

{
    "items": [
        {
            "add_quality_score": "20.0",
            "add_total_score": "20.0",
            "chat_start_datetime": "1572851882000",
            "cid": "eca23a4cb2ba45bbab32b6878775cfd2",
            "agent_email": "123456@123.com",
            "minus_quality_score": "-10.0",
            "minus_total_score": "-20.0",
            "quality_score": "210.0",
            "schemeid": "44aea7fd6f57414f98d190bac0ee2d42",
            "agent_name": "在线客服",
            "agentid": "61673ee8d98d4282a95cdad38ffd5f5b",
            "standard_quality_score": "200.0",
            "standard_total_score": "200.0",
            "total_score": "200.0",
            "update_datetime": "1572954558319"
        }
    ],
    "ret_code": "000000",
    "ret_msg": "查询成功"
}

3、错误编码

3.1、操作成功

业务操作成功。

错误编码错误说明
000000操作成功(除此编码以外的编码为错误编码)

3.2、系统异常

系统服务异常。

错误编码错误说明
900001token为空
900002token已失效,请重新获取
900003signature错误
900004没有找到公司的api配置信息
999999系统未知异常

3.3、业务异常

业务异常。

错误编码错误说明
700001公司id不允许为空
700002坐席id不允许为空
700003客服昵称不允许为空
700004客服真实姓名不允许为空
700005客服角色id不允许为空
700006客服角色不允许为空
700007客服邮箱不允许为空
700008客服邮箱格式不正确
700009客服邮箱已存在