https://api.polyv.net/live/v2/channels/{channelId}/set-token
1、设置频道单点登陆的token
2、接口支持https协议
3、接口URL中的{channelId}为 频道ID
{
"code": 200,
"status": "success",
"message": "",
"data": "success"
}
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
{
"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": ""
}
<?php
//引用config.php
include 'config.php';
//接口需要的参数(非sign)赋值
$channelId = "127075";
$token = "skudjjdkkkkk";
$params = array(
'appId'=>$appId,
'token'=>$token,
'timestamp'=>$timestamp
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
//接口请求url
$url = "https://api.polyv.net/live/v2/channels/$channelId/set-token?appId=$appId×tamp=$timestamp&token=$token&sign=$sign";
//输出接口请求结果
echo file_get_contents($url);
?>