https://api.polyv.net/live/v3/channel/update-viewer-passwd
1、接口用于修改参与者密码,如果没有就新增参与者登录密码。
2、接口支持https
{
"code": 200,
"status": "success",
"message": "",
"data": "success"
}
{
"code": 400,
"status": "error",
"message": "param validate error",
"data": 400
}
{
"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';
$channelId = 10000;
$passwd = "123456";
$params = array(
'appId' => $appId,
'timestamp' => $timestamp,
'channelId' => $channelId,
'passwd' => $passwd
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;
$url = "https://api.polyv.net/live/v3/channel/update-viewer-passwd?".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, 1);
$res = curl_exec($curl);
curl_close($curl);
echo $res;
?>