接口URL
https://api.polyv.net/live/v3/channel/set-thirdpush-enabled
接口说明
(接口调用有频率限制,详细请查看)
1、接口用于设置频道的第三方推流开关
2、接口支持https
返回结果支持格式
JSON
请求方式
POST
请求数限制
TRUE
请求参数
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
appId | 是 | string | 从API设置中获取,在直播系统登记的appId |
timestamp | 是 | long | 13位当前时间戳 |
sign | 是 | string | 签名值 |
channelId | 是 | int | 频道号 |
thirdPushEnabled | 是 | string | 开关值,Y或N,Y表示开启,N表示关闭 |
响应成功JSON示例:
{
"code": 200,
"status": "success",
"message": "",
"data": "success"
}
响应失败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 | 修改成功过时为success |
php请求示例
<?php
//引用config.php
include '/srv/http/config.php';
$params = array(
'appId' => $appId,
'timestamp' => $timestamp,
'channelId' => '206204',
'thirdPushEnabled' => 'Y'
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;
$url = "http://api.polyv.net/live/v3/channel/set-thirdpush-enabled?".http_build_query($params);
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 500);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_URL, $url);
$res = curl_exec($curl);
curl_close($curl);
echo $res;
?>