Get Channel Chat Review Content
Updated: 2022-09-02 18:08:07
Interface URL
https://api.polyv.net/live/v3/channel/chat/get-censor-content
Interface Description
1. Purpose: Used to retrieve chat review content
2. Supports HTTPS protocol
Supported Format
JSON
Request Method
GET
Request Rate Limit
TRUE
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | Yes | string | Obtained from API settings, the appId registered in the live streaming system |
| timestamp | Yes | string | Current time in seconds (13 digits) |
| sign | Yes | String | Signature, a 32-character uppercase MD5 value. The appSecret used to generate the signature is critical for communication data security. It must not be stored or used directly on the client side. All API calls must be relayed through the customer's own server to the POLYV server to obtain response data. See signature generation rules |
| channelId | Yes | int | Channel ID |
| apiVersion | No | string | API version. When apiVersion is 3.1, the following parameters are valid |
| order | No | string | Sort order: ASC (ascending), DESC (descending). Default is ASC |
| page | No | int | Page number. Default is 1 |
| pageSize | No | int | Page size. Default is 10 |
Example of Successful Response
{
"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"
}
}]
}
}
Example of Failed Response
Signature Error
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
Response Field Description
| Name | Type | Description |
|---|---|---|
| code | string | Response code: 200 for success, 400 for failure, 403 for signature error, 500 for exception error |
| status | string | "success" for success, "error" for failure |
| message | string | Error message when failed |
| data | object | Successful response data |
| data.total | int | Number of chat reviews |
| data.jsonList | array | List of chat review content |
| data.jsonList[0].content | string | Chat message content |
| data.jsonList[0].id | string | Chat message ID |
| data.jsonList[0].roomId | string | Chat room ID |
| data.jsonList[0].status | string | Chat message status: "censor" means pending review |
| data.jsonList[0].time | string | Chat message timestamp |
| data.jsonList[0].user | object | Chat user information |
| data.jsonList[0].user.banned | boolean | Whether the user is banned |
| data.jsonList[0].user.channelId | string | Channel ID |
| data.jsonList[0].user.clientIp | string | Client IP |
| data.jsonList[0].user.nick | string | Nickname |
| data.jsonList[0].user.pic | string | Avatar |
| data.jsonList[0].user.uid | string | Socket ID |
| data.jsonList[0].user.roomId | string | Room ID |
| data.jsonList[0].user.sessionId | string | Session ID |
| data.jsonList[0].user.userId | string | User ID |
| data.jsonList[0].user.userType | string | Message sender type: 'monitor', 'assistant', 'viewer', 'guest', 'teacher', 'manager', 'slice' (cloud classroom student) |
| data.pageSize | int | Page size, returned when apiVersion is 3.1 |
| data.pageNumber | int | Current page number, returned when apiVersion is 3.1 |
| data.totalPages | int | Total pages, returned when apiVersion is 3.1 |
PHP Request Example
<?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>";
?>
