分配直播并发数接口-集团账号1.0
更新时间:2023-05-04 18:46:13
接口描述
1、接口用于分配直播的并发数
2、接口支持https协议
接口URL
http://api.polyv.net/v2/group/live/set-concurrences
请求方式
POST
接口约束
1、接口同时支持HTTP 、HTTPS ,建议使用HTTPS 确保接口安全,接口调用有频率限制,详细请查看
请求参数描述
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| appId | true | String | 集团主账号appId【详见集团账号2.0获取密钥】 |
| timestamp | true | Long | 当前13位毫秒级时间戳,3分钟内有效 |
| sign | true | String | 签名,为32位大写的MD5值,生成签名的appSecret密钥作为通信数据安全的关键信息,严禁保存在客户端直接使用,所有API都必须通过客户自己服务器中转调用POLYV服务器获取响应数据【详见签名生成规则】 |
| true | String | 分帐号邮箱 | |
| type | false | String | 分配的类型,add:新增,recover:回收 默认为add新增 |
| concurrences | false | Integer | 分配的并发数,大于0的整数 |
示例
响应参数描述
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | Integer | 响应状态码,200为成功返回,非200为失败【详见全局错误说明】 |
| status | String | 响应状态文本信息 |
| message | String | 响应描述信息,当code为400或者500的时候,辅助描述错误原因 |
| data | String | 请求成功返回success,请求失败为空字符串 |
php请求示例
<?php
//引用config-group.php
include 'config-group.php';
$params = array(
'appId' => $appId,
'email' => $email,
'type' => $type,
'durations' => $durations,
'timestamp' => $timestamp
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;
$url = "https://api.polyv.net/v2/group/live/set-concurrences?".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);
curl_setopt($curl, CURLOPT_POST, 0);
$res = curl_exec($curl);
curl_close($curl);
echo $res;
?>
响应示例
成功示例
{
"code": 200,
"status": "success",
"message": "success",
"data": "success"
}
异常示例
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
