历史消息查询
历史消息查询
API 地址
api.vhallyun.com/api/v2/message/lists
描述
根据频道ID,获取消息列表
入参
关于公共请求参数详细内容,请参考 公共请求参数。
| 参数 | 类型 | 是否必选 | 含义 |
|---|---|---|---|
| channel_id | string | 是 | 频道id |
| type | int | 否 | 查询类型 ,1 聊天列表( 默认),2 自定义聊天列表 |
| curr_page | int | 否 | 当前页,默认为1 |
| page_size | int | 否 | 每页大小,默认为10,最大值为1000 |
| filter_status | int | 否 | 过滤类型 , 0 可查看( 默认),1 不可查看 |
| start_time | date | 是 | 查询开始时间,格式为:2017/01/01 |
| end_time | date | 否 | 查询结束时间,默认为当前时间,格式为:2017/01/01 |
| order_by | string | 否 | 排序方式,asc按照时间升序,desc按照时间倒序,默认desc |
| audit_status | string | 否 | 消息审核状态,默认("0,1,3"【人工审核通过及系统自动审核通过】,可选值:0【未经过消息审核服务】、1【人工审核通过】、2【人工审核拒绝】、3【超过200条自动审核通过】、4【超过200条自动审核拒绝】) |
| msg_type | string | 否 | 要查询消息类型,多个类型用逗号分割,默认文本(text),可选值:text、image、link、video、voice、disable、disable_all、permit、permit_all,传all则获取所有 |
出参
| 参数 | 类型 | 是否必选 | 含义 |
|---|---|---|---|
| list | list | 是 | 消息列表 |
| total | int | 是 | 消息总条数 |
| page_num | int | 是 | 当前页 |
| page_all | int | 是 | 总页数 |
错误码
| 错误码 | 类型 | 含义 |
|---|---|---|
| 10016 | int | 频道ID不能为空 |
| 10020 | int | 开始时间不能为空 |
| 20004 | int | 频道查询为空 |
| 20010 | int | 聊天数据查询为空 |
| 30002 | int | 不是当前频道拥有者 |
| 40002 | int | 消息类型不正确 |
| 40004 | int | 时间类型不正确 |
| 40008 | int | 当前页数不正确 |
| 40009 | int | 分页条目不正确 |
| 40038 | int | 过滤类型不正确 |
| 40040 | int | 开始时间不能大于结束时间 |
| 40049 | int | msg_type含有不允许的类型 |
| 40050 | int | audit_status含有不允许的类型 |
| 40072 | int | 排序类型不正确,值为asc或者desc |
| 70001 | int | 分页条目超过限制,最大1000 |
响应格式
{
"code": 200,
"msg": null,
"data": {
"list":[
{
"msg_id": "", // 消息ID
"type":"text", // 消息类型
"data": "天天", // 用户消息数据
"date_time": "2017-12-22 01:32:25", // 发送消息时间戳
"third_party_user_id": "test1", // 消息发送者的第三方用户ID
"nick_name": "游客1443", // 昵称
"avatar":"", // 头像
"context": {} // 用户自定义消息体
}
],
"total":1,
"page_num":1,
"page_all":1
}
}
