获取观看条件白名单列表

接口URL

https://api.polyv.net/live/v3/channel/auth/get-white-list

接口说明

1、接口用于获取全局或频道的观看条件白名单列表
2、接口支持https

支持格式

JSON

请求方式

GET

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 13位当前时间戳
sign string 签名值
rank int 1为首要条件,2为次要条件
channelId int 频道号,不传为获取全局设置
page int 要获取的页码,默认为1
pageSize int 每页数据量,默认为10
keyword string 关键词,可根据会员码和名称查询

响应成功JSON示例:

{
  "code": 200, 
  "status": "success", 
  "message": "", 
  "data": {
    "pageNumber": 1, 
    "totalPages": 4, 
    "pageSize": 5, 
    "contents": [
      {
        "name": "测试重构1", 
        "phone": "tes1", 
        "isVip": "N"
      }, 
      {
        "name": "测试重构10", 
        "phone": "tes10", 
        "isVip": "N"
      }, 
      {
        "name": "测试重构11", 
        "phone": "tes11", 
        "isVip": "N"
      }, 
      {
        "name": "测试重构12", 
        "phone": "tes12", 
        "isVip": "N"
      }, 
      {
        "name": "测试重构13", 
        "phone": "tes13", 
        "isVip": "N"
      }
    ]
  }
}

响应失败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": ""
}

字段说明

参数名 说明
code 响应代码,成功为200,失败为400,签名错误为401,异常错误500
status 成功为success,失败为error
message 错误时为错误提示消息
data 分页的白名单列表数据
pageNumber 当前页码
totalPages 页面总数
pageSize 每页数据量
contents 当前页面内容
name 昵称(或备注)
phone 会员码

php请求示例

<?php
//引用config.php
include 'config.php';

$channelId="204758";

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'channelId' => $channelId,
  'rank' => '1',
  'page' => 1,
  'pageSize' => 5,
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "http://api.polyv.net/live/v3/channel/auth/get-white-list?".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;
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...