获取频道聊天审核内容
更新时间:2022-09-02 18:08:07
接口URL
https://api.polyv.net/live/v3/channel/chat/get-censor-content
接口说明
1、作用:用于获取聊天审核内容接口
2、接口支持https协议
支持格式
JSON
请求方式
GET
请求数限制
TRUE
请求参数
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| appId | 是 | string | 从API设置中获取,在直播系统登记的appId |
| timestamp | 是 | string | 当前时间的秒级时间戳(13位) |
| sign | 是 | String | 签名,为32位大写的MD5值,生成签名的appSecret密钥作为通信数据安全的关键信息,严禁保存在客户端直接使用,所有API都必须通过客户自己服务器中转调用POLYV服务器获取响应数据【详见签名生成规则】 |
| channelId | 是 | int | 频道号 |
| apiVersion | 否 | string | 接口版本,当apiVersion为3.1时,以下参数才有效 |
| order | 否 | string | 排序,ASC顺序、DESC倒序,默认ASC |
| page | 否 | int | 分页页码、默认1 |
| pageSize | 否 | int | 分页大小,默认10 |
操作成功响应示例
{
"code": 200,
"message": "",
"status": "success",
"data": {
"total": 1,
"jsonList": [{
"content": "2222",
"id": "3e46f9b0-8f3c-11ea-ab59-cf9e43099504",
"roomId": "421810",
"status": "censor",
"time": 1588729949374,
"user": {
"banned": false,
"channelId": "421810",
"clientIp": "61.144.147.235",
"nick": "233",
"pic": "https://s1.videocc.net/face.png",
"roomId": "421810",
"sessionId": "flrqsfma26",
"uid": "pzQ-bhKFIA9BUU5DAKfE",
"userId": "1588729887414",
"userType": "slice"
}
}]
}
}
操作失败响应示例
签名错误
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
响应字段说明
| 名称 | 类型 | 说明 |
|---|---|---|
| code | string | 响应代码,成功为200,失败为400,签名错误为403,异常错误500 |
| status | string | 成功为success,失败为error |
| message | string | 错误时为错误提示消息 |
| data | object | 成功返回信息 |
| data.total | int | 审核聊天数量 |
| data.jsonList | array | 审核聊天内容列表 |
| data.jsonList[0].content | string | 聊天消息内容 |
| data.jsonList[0].id | string | 聊天消息ID |
| data.jsonList[0].roomId | string | 聊天房间号 |
| data.jsonList[0].status | string | 聊天消息状态,"censor":待审核 |
| data.jsonList[0].time | string | 聊天消息时间戳 |
| data.jsonList[0].user | object | 聊天用户信息 |
| data.jsonList[0].user.banned | boolean | 用户是否被封禁 |
| data.jsonList[0].user.channelId | string | 频道号 |
| data.jsonList[0].user.clientIp | string | 客户IP |
| data.jsonList[0].user.nick | string | 昵称 |
| data.jsonList[0].user.pic | string | 头像 |
| data.jsonList[0].user.uid | string | socketId |
| data.jsonList[0].user.roomId | string | 房间号 |
| data.jsonList[0].user.sessionId | string | 场次ID |
| data.jsonList[0].user.userId | string | 用户ID |
| data.jsonList[0].user.userType | string | 消息发言人类型('monitor':监控者, 'assistant':助教, 'viewer':特邀观众, 'guest':嘉宾, 'teacher':讲师,、 'manager':管理员, 'slice':云课堂学生) |
| data.pageSize | int | 分页大小,当参数apiVersion为3.1时返回 |
| data.pageNumber | int | 当前页码,当参数apiVersion为3.1时返回 |
| data.totalPages | int | 总页数,当参数apiVersion为3.1时返回 |
php请求示例
<?php
//引用config.php
include 'config.php';
$params = array(
'appId'=>$appId,
'channelId'=>$channelId,
'timestamp'=>$timestamp
);
//生成sign
$sign = getSign($params); //详细查看config.php文件
$params['sign'] = $sign;
$url="https://api.polyv.net/live/v3/channel/chat/get-censor-content?".http_build_query($params);
echo "<script>window.location.href='$url'</script>";
?>
