Get Custom Registered User Information
Updated: 2022-09-02 18:08:07
Interface URL
http://api.polyv.net/live/v2/app/get-custom-user
Interface Description
1、接口用于获取用户信息
2、接口支持https
Supported Format
JSON
Request Method
GET
Request Limit
TRUE
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | Yes | string | APPID required for calling the interface |
| timestamp | Yes | long | Current 13-digit timestamp |
| 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 as an intermediary to obtain response data from the POLYV server. See Signature Generation Rules |
| Yes | string | Email address |
Successful Response JSON Example:
{
"code": 200,
"status": "success",
"message": "",
"data": {
"name": "alexydz",
"mobile": "15903079988",
"company": "xxxx company",
"userId": "ecf5ee31fb",
"email": "1111111@ruizaiyun.com"
}
}
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 error |
| data.userId | User ID |
| data.email | User account email address |
| data.name | User name |
| data.company | User's organization |
| data.mobile | User's phone number |
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";
$params = array(
'appId' => $appId,
'timestamp' => $timestamp,
'email' => $email
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;
$url = "http://api.polyv.net/live/v2/app/get-custom-user?".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;
?>
