获取员工会话列表
由于功能升级 该接口将于2022/9/15下线;历史已接入的企业需要调用获取员工消息接口来获取员工在单聊场合和群聊场景下的会话消息获取指定员工的聊天会话列表
请求方式: GET(HTTPS)
请求地址: https://open.wshoto.com/openapi/chat/session/list
参数说明:
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
access_token | string | 是 | 调用接口凭证 |
userid | string | 否 | 企业成员的userid |
order_by | int | 否 | 列表排序方式。可选值为 0:最后联系时间倒序 和 1: 默认排序 |
current_index | int | 否 | 页码。默认值为1 |
page_size | int | 否 | 列表返回长度。默认值为20,最大值为100 |
返回值:
{
"code": 0,
"msg": "请求成功",
"data": {
"total": 1,
"records": [
{
"userid": "YunHanceshi",
"target_id": "wmROPkDQAAiBpBIXbWBTdeXqFIyI8k2A",
"room_id": null,
"session_type": "ext_user",
"name": "客户姓名",
"avatar": "http://p.qlogo.cn/bizmail/IcsdgagqefergqerhewSdage/0",
"last_content": "你好",
"last_msg_type": "text",
"last_msg_time": 1608269181797
},
{
"userid": "YunHanceshi",
"target_id": "wrROPkDQAAA8iGZUBM2_FKpmpYNEBwjQ",
"room_id": "wrROPkDQAAA8iGZUBM2_FKpmpYNEBwjQ",
"session_type": "room",
"name": "群聊",
"avatar": null,
"last_content": "你好",
"last_msg_type": "text",
"last_msg_time": 1608269181797
}
]
}
}
返回说明:
参数 | 类型 | 说明 | |
---|---|---|---|
code | int | 出错返回码,为0表示成功,非0表示调用失败 | |
msg | string | 返回码描述 | |
data | Page | 分页对象 | |
total | int | 总量 | |
records | ChatSession[] | 群聊列表 | |
userid | string | 员工id | |
target_id | string | 聊天对象id,根据对象类型不同会指代不同的id | |
room_id | string | 聊天群id | |
session_type | int | 对象类型,0:内部联系人,1:外部联系人, 2:群聊 | |
name | string | 对象名称,某些情况下可能无法获取到id,此时用对象id代替 | |
avatar | string | 对象头像,某些情况下不存在 | |
last_content | string | 最后一条消息 | |
last_msg_type | string | 最后一条消息类型 | |
last_msg_time | long | 最后一条消息接收时间 |