更新时间: 2021-03-08
# 功能描述
如用户开通了单群聊消息云存储服务,可通过此接口按会话清除某用户指定时间之前服务端存储的历史消息,清除后用户在客户端无法再获取到存储到融云服务端历史消息,请谨慎执行此操作。
# 实现方法
# 输入参数
参数 | 类型 | 必传 | 说明 |
---|---|---|---|
conversationType | String | 是 | 会话类型,支持单聊、群聊、系统会话。单聊会话是 1、群组会话是 3、系统通知是 6 |
fromUserId | String | 是 | 用户 ID,删除该用户指定会话 msgTimestamp 前的历史消息 |
targetId | String | 是 | 需要清除的目标会话 ID |
msgTimestamp | String | 是 | 清除该时间戳之前的所有历史消息,精确到毫秒,为空时清除该会话的所有历史消息。 |
支持的会话类型为: 单聊、群聊、系统。不支持清除聊天室历史消息
# 返回结果
返回值 | 返回类型 | 说明 |
---|---|---|
code | Int | 返回码,200 为正常。 |
# 示例代码
请求地址: https://数据中心域名/conversation/message/history/clean.json
请求方法: POST
调用频率: 每秒钟限 100 次
签名规则: 所有请求融云服务端 API 接口的请求均需要进行规则校验,详细请参考 通用 API 接口签名规则
Request:
POST /conversation/message/history/clean.json HTTP/1.1 Host: api-cn.ronghub.com App-Key: uwd1c0sxdlx2 Timestamp: 1408710653491 Nonce: 14314 Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8 Content-Type: Application/x-www-form-urlencoded fromUserId=1&targetId=8888&conversationType=3&msgTimestamp=1566281295943
已复制
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
Response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 {"code":200}
已复制
1
2
3
4
2
3
4