保利威文档中心

幫助中心

設定密碼

更新時間:2022-09-02 18:08:07

介面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;
?>
联系客服,在线咨询