查询历史聊天信息
接口URL
接口说明
支持格式
请求方式
请求数限制
请求参数
startDay
是
String
聊天记录的开始时间,格式要求为yyyy-MM-dd(如:2017-08-01)或者 yyyy-MM-dd HH:mm:ss (如:2017-08-01 16:30:12)
endDay
是
string
聊天记录的结束时间,要求同上
appId
是
string
从API设置中获取,在直播系统登记的appId
page
否
int
获取第几页聊天记录,默认为1
limit
否
int
每页记录数,默认为1000
timestamp
是
string
当前13位毫秒级时间戳,3分钟内有效
sign
是
string
签名,32位大写MD5值
userType
否
string
用户类型,可以选择多个类型,用英文逗号隔开。可选值包括: slice:云课堂学员 teacher:讲师 guest:嘉宾 manager:管理员 assistant:助教 viewer:特邀观众 monitor:场监 attendee:研讨会参与者 student:普通直播观众
status
否
string
聊天记录状态,默认:pass(已审核),审核状态,pass:已审核,censor:审核中和删除
source
否
string
类型,不填默认公聊,extend:管理员私聊
roomId
否
string
如果有房间号,需要传入房间号,默认不传
响应成功JSON示例
响应失败JSON示例:
未输入appId
appId不正确
时间戳错误
签名错误
频道号错误
开始时间为空
结束时间为空
开始时间格式不正确 (正确格式为yyyy-MM-dd)
开始时间格式不正确 (正确格式为yyyy-MM-dd)
结束时间晚于开始时间
其他错误
字段说明
code
int
请求状态响应码
status
string
请求状态
message
string
错误信息
data
array
数据列表
data[0].accountId
string
账号Id
data[0].clientIP
string
用户IP
data[0].content
string
聊天内容
data[0].id
string
聊天消息id
data[0].image
string
图片消息的图片地址
data[0].msgType
string
目前取值: redpaper: 红包消息; chatImg:图片消息; custom:自定义消息(通过socket发送的自定义消息); reward:打赏消息; customerMessage:自定义消息(通过http接口发送的自定义消息) 为空(msgType="")时表示普通聊天消息;
data[0].quote
string
data[0].roomId
string
频道号
data[0].sessionId
string
场次号
data[0].time
string
发送消息时的时间戳
data[0].status
string
审核状态,pass:已审核,censor:审核中,delete:删除
data[0].userType
string
用户类型,可能的值为:slice:云课堂学员 teacher:讲师 guest:嘉宾 manager:管理员 assistant:助教 viewer:特邀观众 monitor:场监 attendee:研讨会参与者 student:普通直播观众
data[0].sourceType
string
消息来源,目前有public(群聊)、extend(管理员私聊)
data[0].user.clientIp
string
用户IP
data[0].user.nick
string
观众昵称
data[0].user.pic
string
观众头像
data[0].user.roomId
string
房间号
data[0].user.userId
string
用户唯一标示
data[0].user.uid
string
socketId
data[0].user.sessionId
string
场次号
data[0].user.channelId
int
频道号
data[0].user.banned
boolean
是否禁言
data[0].user.actor
string
角色
data[0].user.userType
string
用户类型,可能的值为:slice:云课堂学员 teacher:讲师 guest:嘉宾 manager:管理员 assistant:助教 viewer:特邀观众 monitor:场监 attendee:研讨会参与者 student:普通直播观众
content类型说明
content
字段类型受msgType
字段影响,如果msgType
为空,则表示普通发言,content
为字符串类型。如果msgType
为其它类型,则content
为对象。
msyType为redpaper
表示红包,content
对象为
conetnt
string
红包说明
msgSource
string
字符串redpaper
number
number
红包数量
redCacheId
string
红包缓存id
redpackId
string
红包id
totalAmount
number
红包总数量
type
string
红包类型,normal为普通红包,rain为红包雨
msyType为chatImg
发送图片,content
对象为
id
string
图片id
msgSource
string
字符串 chatImg
size
object
图片尺寸信息,其中width表示宽度,height表示高度
status
string
图片成功状态
type
string
字符串chatImg
uploadImgUrl
string
图片链接地址
msyType为custom
发送自定义消息,content
对象为
msgSource
string
字符串custom
EVENT
string
自定义消息事件名称
version
number
自定义消息版本
emitMode
number
自定义消息广播类型,0表示广播到房间内所有人,包括自己;1表示广播到房间,除了自己;2表示指定socketID进行广播。
tip
string
自定义消息提示
data
object
自定义消息内容,由调用者自定义
php请求示例
Last updated
Was this helpful?