Login API
Updated: 2022-09-02 18:08:07
API URL
http://{自定义的后台域名}/login-check
API Description
1、接口用于登录
2、接口支持https
Supported Format
JSON
Request Method
POST
Request Limit
TRUE
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | Yes | string | APPID required for API calls |
| timestamp | Yes | long | Current timestamp in 13-digit milliseconds |
| sign | Yes | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must never be saved 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 |
| Yes | string | Email address | |
| passwd | Yes | string | Login password |
Successful Response JSON Example:
{
"code": 200,
"status": "success",
"message": "",
"data": "http://xxxxxxx.xxxxx.com/#/channel"
}
Response Field Description
| Parameter | Description |
|---|---|
| code | Status code: 200 for success, 403 for signature failure, 400 for parameter error, 500 for server error |
| status | "success" for success, "error" for error |
| message | Empty string for success, error description for failure |
| data | Redirect URL after successful login |
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';
$email = "xxxxx@xxxx.com";
$passwd = "123456";
$params = array(
'appId' => $appId,
'timestamp' => $timestamp,
'email' => $email,
'passwd' => $passwd,
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;
$url = "http://{自定义的后台域名}/login-check?".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;
?>
