Modify Participant Password API
Updated: 2022-09-02 18:08:07
API URL
https://api.polyv.net/live/v3/channel/update-viewer-passwd
API Description
1、接口用于修改参与者密码,如果没有就新增参与者登录密码。
2、接口支持https
Supported Format
JSON
Request Method
POST
Request Rate Limit
TRUE
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | Yes | string | APPID required for calling the API |
| timestamp | Yes | long | Current 13-digit timestamp |
| sign | Yes | String | Signature, a 32-character uppercase MD5 value. The appSecret used to generate the signature is critical for communication data security. It must not be stored or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. For details, see Signature Generation Rules |
| channelId | Yes | int | Channel ID |
| passwd | Yes | string | Password to be modified |
Successful Response JSON Example:
{
"code": 200,
"status": "success",
"message": "",
"data": "success"
}
Response Field Description
| Parameter | Description |
|---|---|
| code | Status code: 200 for success, 403 for signature error, 400 for parameter error, 500 for server error |
| status | "success" for success, "error" for error |
| message | Empty string for success, error description for error |
| data | Success prompt message |
Failed Response JSON Example:
Parameter error
{
"code": 400,
"status": "error",
"message": "param validate error",
"data": 400
}
Missing appId
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
Incorrect appId
{
"code": 400,
"status": "error",
"message": "application not found.",
"data": ""
}
Timestamp error
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
Signature error
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
PHP Request Example
<?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;
?>
