trait HistoryTrait (View source)

历史记录

Methods

array
historyQuerySessionMsg(string $from, string $to, string $begintime, string $endtime = null, int $limit = 100, int $reverse = 2, string $type = null)

单聊云端历史消息查询

array
historyQueryTeamMsg(string $tid, string $accid, string $begintime, string $endtime = null, int $limit = 100, int $reverse = 2, string $type = null)

群聊云端历史消息查询

array
historyQueryChatroomMsg(int $roomid, string $accid, string $timetag, int $limit = 100, int $reverse = 2, string $type = null)

聊天室云端历史消息查询 此接口有频控限制,每分钟可调用不超过1200次

bool|array
historyDeleteHistoryMessage(int $roomid, string $fromAcc, int $msgTimetag)

删除聊天室云端历史消息

array
historyQueryUserEvents(string $accid, string $begintime, string $endtime, int $limit = 100, int $reverse = 2)

用户登录登出事件记录查询 跟据时间段查询用户的登录登出记录,每次最多返回100条。 不提供分页支持,第三方需要跟据时间段来查询。

array|bool
historyDeleteMediaFile(int $channelid)

删除音视频/白板服务器录制文件

array
historyQueryBroadcastMsg(int $broadcastId = 0, int $limit = 100, int $type = 1)

批量查询广播消息

array
historyQueryBroadcastMsgById(int $broadcastId)

查询单条广播消息

Details

array historyQuerySessionMsg(string $from, string $to, string $begintime, string $endtime = null, int $limit = 100, int $reverse = 2, string $type = null)

单聊云端历史消息查询

Parameters

string $from 发送者accid
string $to 接收者accid
string $begintime 开始时间,ms
string $endtime 截止时间,ms
int $limit 本次查询的消息条数上限(最多100条),小于等于0,或者大于100,会提示参数错误
int $reverse 1按时间正序排列,2按时间降序排列。其它返回参数414错误.默认是按降序排列
string $type 查询指定的多个消息类型,类型之间用","分割,不设置该参数则查询全部类型消息格式示例: 0,1,2,3;类型支持: 1:图片,2:语音,3:视频,4:地理位置,5:通知,6:文件,10:提示,11:Robot,100:自定义

Return Value

array $result 或 ['error'=>true,'message'=>$message]

array historyQueryTeamMsg(string $tid, string $accid, string $begintime, string $endtime = null, int $limit = 100, int $reverse = 2, string $type = null)

群聊云端历史消息查询

Parameters

string $tid 群id
string $accid 查询用户对应的accid
string $begintime 开始时间,ms
string $endtime 截止时间,ms
int $limit 本次查询的消息条数上限(最多100条),小于等于0,或者大于100,会提示参数错误
int $reverse 1按时间正序排列,2按时间降序排列。其它返回参数414错误.默认是按降序排列
string $type 查询指定的多个消息类型,类型之间用","分割,不设置该参数则查询全部类型消息格式示例: 0,1,2,3;类型支持: 1:图片,2:语音,3:视频,4:地理位置,5:通知,6:文件,10:提示,11:Robot,100:自定义

Return Value

array $result 或 ['error'=>true,'message'=>$message]

array historyQueryChatroomMsg(int $roomid, string $accid, string $timetag, int $limit = 100, int $reverse = 2, string $type = null)

聊天室云端历史消息查询 此接口有频控限制,每分钟可调用不超过1200次

Parameters

int $roomid 聊天室id
string $accid 查询用户对应的accid
string $timetag 查询的时间戳锚点,13位。reverse=1时timetag为起始时间戳,reverse=2时timetag为终止时间戳
int $limit 本次查询的消息条数上限(最多200条),小于等于0,或者大于200,会提示参数错误
int $reverse 1按时间正序排列,2按时间降序排列。其它返回参数414错误.默认是按降序排列
string $type 查询指定的多个消息类型,类型之间用","分割,不设置该参数则查询全部类型消息格式示例: 0,1,2,3;类型支持: 1:图片,2:语音,3:视频,4:地理位置,5:通知,6:文件,10:提示,11:Robot,100:自定义

Return Value

array $result 或 ['error'=>true,'message'=>$message]

bool|array historyDeleteHistoryMessage(int $roomid, string $fromAcc, int $msgTimetag)

删除聊天室云端历史消息

Parameters

int $roomid 聊天室id
string $fromAcc 消息发送者的accid
int $msgTimetag 消息的时间戳,单位毫秒,应该拿到原始消息中的时间戳为参数

Return Value

bool|array true 或 ['error'=>true,'message'=>$message]

array historyQueryUserEvents(string $accid, string $begintime, string $endtime, int $limit = 100, int $reverse = 2)

用户登录登出事件记录查询 跟据时间段查询用户的登录登出记录,每次最多返回100条。 不提供分页支持,第三方需要跟据时间段来查询。

Parameters

string $accid 要查询用户的accid
string $begintime 开始时间,ms
string $endtime 截止时间,ms
int $limit 本次查询的消息条数上限(最多100条),小于等于0,或者大于100,会提示参数错误
int $reverse 1按时间正序排列,2按时间降序排列。其它返回参数414错误。默认是按降序排列

Return Value

array $result 或 ['error'=>true,'message'=>$message]

array|bool historyDeleteMediaFile(int $channelid)

删除音视频/白板服务器录制文件

Parameters

int $channelid 需要删除的文件的通道号

Return Value

array|bool true 或 ['error'=>true,'message'=>$message]

array historyQueryBroadcastMsg(int $broadcastId = 0, int $limit = 100, int $type = 1)

批量查询广播消息

Parameters

int $broadcastId 查询的起始ID,0表示查询最近的limit条。默认0。
int $limit 查询的条数,最大100。默认100。
int $type 查询的类型,1表示所有,2表示查询存离线的,3表示查询不存离线的。默认1。

Return Value

array $result['msgs'] 或 ['error'=>true,'message'=>$message]

array historyQueryBroadcastMsgById(int $broadcastId)

查询单条广播消息

Parameters

int $broadcastId 广播消息ID,应用内唯一。

Return Value

array $result['msg'] 或 ['error'=>true,'message'=>$message]