设置密码
接口URL
https://api.polyv.net/live/v3/user/update-password
接口说明
设置密码
支持格式
JSON
请求方式
POST
请求参数
参数名
必选
类型及范围
说明
sign
true
String
签名,为32位大写的MD5值,生成签名的appSecret密钥作为通信数据安全的关键信息,严禁保存在客户端直接使用,所有API都必须通过客户自己服务器中转调用POLYV服务器获取响应数据
【详见签名生成规则】
appId
true
string
开发者账号下的appId
timestamp
true
string
13位当前时间的时间戳
newPassword
true
string
新密码
返回错误结果JSON示例
签名错误:
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
密码长度不正确:
{
"code": 1113,
"status": "error",
"message": "param length is incorrect: newPassword",
"data": ""
}
返回正确结果JSON示例
{
"code": 200,
"status": "success",
"message": "",
"data": ""
}
字段说明
字段
类型及范围
说明
code
int32
返回码
status
string
返回状态
message
string
返回信息
data
string
操作结果
PHP请求示例
<?php
//引用config.php
include 'config.php';
//接口需要的参数(非sign)赋值
$appId = "XXXXXXXX";
$newPassword = "127075";
$timestamp = "123123123123";
$params = array(
'appId'=>$appId,
'newPassword'=>$newPassword,
'timestamp'=>$timestamp
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;
$url = "https://api.polyv.net/live/v3/user/update-password?".http_build_query($params);
$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;
?>
Last updated
Was this helpful?