接口调用说明
通过该接口查询人工客服分析数据
请求URL示例
https://console.tim.qq.com/v4/desk_http_svc/describe_agent_statistics?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
请求参数说明
参数 | 说明 |
v4/desk_http_svc/describe_agent_statistics | 请求接口。 |
sdkappid | 创建应用时即时通信 IM 控制台分配的 SDKAppID。 |
identifier | |
usersig | |
random | 请输入随机的32位无符号整数,取值范围0 - 4294967295。 |
contenttype | 请求格式固定值为 json 。 |
请求包示例
{"From": 1736697600,"To": 1736870399,"AgentIds": ["1289316652@qq.com"],"Limit": 10,"Offset": 0}
请求包字段说明
字段 | 类型 | 属性 | 说明 |
From | Integer | 必填 | 起始时间,Unix 秒级时间戳。 注意:当前只支持按天的数据统计,开始时间当天0点时间戳。 |
To | Integer | 必填 | 结束时间,Unix 秒级时间戳。 注意:当前只支持按天的数据统计,结束时间当天23:59:59时间戳。 |
Limit | Integer | 选填 | 返回记录条数,最大为100默认100。 示例值:100。 |
Offset | Integer | 选填 | 返回记录偏移,默认为 0。 示例值:0。 |
AgentIds | String | 选填 | 指定要查询的客服列表。 |
应答包体示例
{"ActionStatus": "OK","ErrorCode": 0,"ErrorInfo": "","TotalCount": 5,"Data": [{"AgentId": "1289316652@qq.com","AgentNickName": "美美","FirstLoginTimestamp": 1738923814,"LastLogoutTimestamp": 1738934235,"FreeTime": 3600,"BusyTime": 300,"RestTime": 600,"TotalSessionCnt": 12,"TransferSessionCnt": 0,"EffectiveSessionCnt": 8,"AgentEndCnt": 10,"ServeUserCnt": 10,"TotalAcceptTime": 1527,"TotalMsgCnt": 450,"AgentMsgCnt": 200,"UserMsgCnt": 150,"NotRespSessionCnt": 2,"AvgFirstRespTime": 10,"FirstRespUnder30sCnt": 9,"AvgRespTime": 25,"AvgRespUnder30sCnt": 8,"AvgAcceptTime": 300,"SatisfactionSelectedCnt": 8,"SatisfiedCnt": 6}]}
应答包字段说明
字段 | 类型 | 说明 |
ErrorCode | Integer | 错误码: 0表示成功。 非0表示失败。 |
ErrorInfo | String | 错误信息。 |
ActionStatus | String | 请求处理的结果。 |
TotalCount | Integer | 总记录数。 |
Data | Array | 客服统计数据列表。 |
AgentId | String | 人工客服 ID。 |
AgentNickName | String | 客服昵称。 |
FirstLoginTimestamp | Integer | 首次登录时间,单位:秒。 |
LastLogoutTimestamp | Integer | 最后下线时间,单位:秒。 |
FreeTime | Integer | 示闲时长,单位:秒。 |
BusyTime | Integer | 示忙时长,单位:秒。 |
RestTime | Integer | 小休时长,单位:秒。 |
TotalSessionCnt | Integer | 客服接待总会话数。 |
TransferSessionCnt | Integer | 转接会话数。 |
EffectiveSessionCnt | Integer | 有效会话数。 |
AgentEndCnt | Integer | 客服主动结束会话数。 |
ServeUserCnt | Integer | 接待用户数。 |
TotalAcceptTime | Integer | 总会话时长,单位:秒。 |
TotalMsgCnt | Integer | 总消息数。 |
AgentMsgCnt | Integer | 客服消息数。 |
UserMsgCnt | Integer | 用户消息数。 |
NotRespSessionCnt | Integer | 未回复会话数。 |
AvgFirstRespTime | Integer | 平均首次响应时长,单位:秒。 |
FirstRespUnder30sCnt | Integer | 首次响应时长在30秒内会话数。 |
AvgRespTime | Integer | 平均响应时长,单位:秒。 |
AvgRespUnder30sCnt | Integer | 平均响应时长在30秒内会话数。 |
AvgAcceptTime | Integer | 平均会话时长,单位:秒。 |
SatisfactionSelectedCnt | Integer | 评价会话数。 |
SatisfiedCnt | Integer | 满意评价会话数(4星及5星数量)。 |
错误码说明
除非发生网络错误(例如502错误),否则该接口的 HTTP 返回码均为200。真正的错误码,错误信息是通过应答包体中的 ErrorCode、ErrorInfo 来表示的。
本 API 私有错误码如下:
错误码 | 描述 |
141000 | 该应用非智能客服应用。 |
141002 | 内部错误,请重试。 |
141004 | 参数非法。 |
141009 | 接口限频。 |