文章目录
接口URL
https://api.polyv.net/live/v3/channel/auth/get-record-info
接口说明
(接口调用有频率限制,详细请查看)
1、接口用于获取频道的登记观看列表数据内容
2、接口支持https
返回结果支持格式
JSON
请求方式
GET
请求数限制
TRUE
请求参数
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
appId | 是 | string | 从API设置中获取,在直播系统登记的appId |
timestamp | 是 | long | 13位当前时间戳 |
sign | 是 | string | 签名值 |
channelId | 是 | int | 频道号 |
page | 否 | int | 要获取的页码,默认为1 |
pageSize | 否 | int | 每页数据量,默认为10 |
响应成功JSON示例:
{
"code": 200,
"status": "success",
"message": "",
"data": {
"pageNumber": 1,
"totalPages": 1,
"pageSize": 10,
"contents": [
{
"createdTime": 1531982204000,
"params": [
"黄泉"
]
},
{
"createdTime": 1531982194000,
"params": [
"黄天"
]
},
{
"createdTime": 1531982185000,
"params": [
"小明"
]
},
{
"createdTime": 1531814855000,
"params": [
"ffff"
]
}
]
}
}
响应失败JSON示例:
未输入appId
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
appId不正确
{
"code": 400,
"status": "error",
"message": "application not found.",
"data": ""
}
时间戳错误
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
签名错误
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
channelId为空
{
"code": 400,
"status": "error",
"message": "param should not be empty: channelId",
"data": ""
}
channelId为非数字
{
"code": 400,
"status": "error",
"message": "param is not number: channelId",
"data": ""
}
频道非法
{
"code": 403,
"status": "error",
"message": "illegal channel id: 206240",
"data": ""
}
字段说明
参数名 | 说明 |
---|---|
code | 响应代码,成功为200,失败为400,签名错误为401,异常错误500 |
status | 成功为success,失败为error |
message | 错误时为错误提示消息 |
data | 分页的登记观看列表数据 |
pageNumber | 当前页码 |
totalPages | 页面总数 |
pageSize | 每页数据量 |
contents | 当前页面内容 |
createdTime | 登记时间 |
params | 登记的内容数据 |
php请求示例
<?php
//引用config.php
include '/srv/http/config.php';
$channelId="206204";
$params = array(
'appId' => $appId,
'timestamp' => $timestamp,
'channelId' => $channelId,
'page' => '1',
'pageSize' => '10'
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;
$url = "http://api.polyv.net/live/v3/channel/auth/get-record-info?".http_build_query($params);
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 500);
curl_setopt($curl, CURLOPT_URL, $url);
$res = curl_exec($curl);
curl_close($curl);
echo $res;
?>