Get Live Monitoring Information API
Updated: 2022-09-02 18:08:07
API URL
https://api.polyv.net/live/v3/channel/monitor/get-info
API Description
1. Purpose: Used to retrieve live monitoring information
2. The API supports the 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-digit timestamp) |
| sign | Yes | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not be stored or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server to obtain response data. See Signature Generation Rules |
| channelId | Yes | int | Channel ID |
Example of Successful Response
{
"code": 200,
"message": "",
"status": "success",
"data": {
"userId": "xxxxx",
"status": "N",
"banPush": "N",
"scene": "alone",
"debugEnabled": "N",
"marqueeEnabled": "Y",
"consultingMenuEnabled": "Y",
"cdnType": "uc",
"sign": "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
"roomIds": "",
"roomSign": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"chatTranslateEnabled": "Y",
"showCustomMessageEnabled": "Y",
"chatAdmin": {
"channelId": xxxxxx,
"type": "admin",
"nickname": "管理员",
"actor": "管理员",
"avatar": "//s1.videocc.net/face.png",
"createdTime": 1588678231000,
"lastModified": 1588678231000
},
"chatToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"chatEnabled": "Y"
}
}
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 an error occurs |
| data | object | Success response data |
| data.userId | string | User ID |
| data.status | string | Current live streaming status (Y/N) |
| data.banPush | string | Whether push streaming is prohibited (Y/N) |
| data.scene | string | Current live streaming scene ("alone": standard live; "topclass": large class; "ppt": three-screen) |
| data.debugEnabled | string | Whether debug mode is enabled (Y/N) |
| data.marqueeEnabled | string | Marquee toggle (Y/N) |
| data.consultingMenuEnabled | string | Consultation/Question toggle (Y/N) |
| data.cdnType | string | CDN type |
| data.sign | string | Channel room chat room sign |
| data.roomIds | string | Multi-room IDs |
| data.roomSign | string | Multi-room chat room sign |
| data.chatTranslateEnabled | string | Chat translation toggle (Y/N) |
| data.showCustomMessageEnabled | string | Whether to display custom messages toggle (Y/N) |
| data.chatToken | string | Chat room token |
| data.chatAdmin | object | Chat room admin information object |
| data.chatAdmin.channelId | int | Chat room corresponding channel ID |
| data.chatAdmin.type | string | Chat room role type |
| data.chatAdmin.nickname | string | Chat room admin nickname |
| data.chatAdmin.actor | string | Chat room admin title |
| data.chatAdmin.avatar | string | Chat room admin avatar |
| data.chatAdmin.createdTime | string | Chat room admin creation time |
| data.chatAdmin.lastModified | string | Chat room admin last update time |
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/monitor/get-info?".http_build_query($params);
echo "<script>window.location.href='$url'</script>";
?>
