接口调用说明
通过该接口查询会话统计数据。
请求 URL 示例
https://console.tim.qq.com/v4/desk_http_svc/describe_session_statistics?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
请求参数说明
参数 | 说明 |
v4/desk_http_svc/describe_session_statistics | 请求接口。 |
sdkappid | 创建应用时即时通信 IM 控制台分配的 SDKAppID。 |
identifier | |
usersig | |
random | 请输入随机的32位无符号整数,取值范围0 - 4294967295。 |
contenttype | 请求格式固定值为 json 。 |
请求包示例
{"From": 1736697600,"To": 1736870399,"GroupByHour": true}
请求包字段说明
字段 | 类型 | 属性 | 说明 |
From | Integer | 必填 | 起始时间,Unix 秒级时间戳。 |
To | Integer | 必填 | 结束时间,Unix 秒级时间戳。 |
GroupByHour | Bool | 选填 | 指定查询数据是否按小时进行聚合。 默认为false则按天进行聚合 |
应答包体示例
{"ActionStatus": "OK","ErrorCode": 0,"ErrorInfo": "","TotalCount": 5,"Data": [{"Time": "2025-04-06","TotalSessionCnt": 12,"TransferAgentSessionCnt": 10,"AgentAcceptCnt": 9,"EffectiveSessionCnt": 8,"SatisfactionSelectedCnt": 5,"OneStarSelectedCnt": 1,"TwoStarSelectedCnt": 1,"ThreeStarSelectedCnt": 1,"FourStarSelectedCnt": 1,"FiveStarSelectedCnt": 1,"AvgFirstRespTime": 10,"AvgRespTime": 25,"AvgAcceptTime": 300,"AvgQueueTime": 6}]}
应答包字段说明
字段 | 类型 | 说明 |
ErrorCode | Integer | 错误码: 0表示成功。 非0表示失败。 |
ErrorInfo | String | 错误信息。 |
ActionStatus | String | 请求处理的结果。 |
Data | Array | 会话统计数据列表。 |
Time | String | 时间: 按天聚合则为年月日,例:"2025-04-06"。 按小时聚合则为整点小时时间,例:"09:00"。 |
TotalSessionCnt | Integer | 总会话数。 |
TransferAgentSessionCnt | Integer | 转人工会话数。 |
AgentAcceptCnt | Integer | 人工接待会话数。 |
EffectiveSessionCnt | Integer | 有效会话数。 |
SatisfactionSelectedCnt | Integer | 评价会话数。 |
OneStarSelectedCnt | Integer | 1星评价数。 |
TwoStarSelectedCnt | Integer | 2星评价数。 |
ThreeStarSelectedCnt | Integer | 3星评价数。 |
FourStarSelectedCnt | Integer | 4星评价数。 |
FiveStarSelectedCnt | Integer | 5星评价数。 |
AvgFirstRespTime | Integer | 平均首次响应时长,单位:秒。 |
AvgRespTime | Integer | 平均响应时长,单位:秒。 |
AvgAcceptTime | Integer | 平均会话时长,单位:秒。 |
AvgQueueTime | Integer | 平均排队时长,单位:秒。 |
错误码说明
除非发生网络错误(例如502错误),否则该接口的 HTTP 返回码均为200。真正的错误码,错误信息是通过应答包体中的 ErrorCode、ErrorInfo 来表示的。
本 API 私有错误码如下:
错误码 | 描述 |
141000 | 该应用非智能客服应用。 |
141002 | 内部错误,请重试。 |
141004 | 参数非法。 |
141009 | 接口限频。 |
接口调试工具