Polyv Help Center

Help Center

Custom User Registration API

Updated: 2022-09-02 18:08:07

API URL

http://api.polyv.net/live/v2/app/add-custom-user

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 13-digit Unix 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 never 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
saleId No int Sales ID
email Yes string Email address
mobile Yes string Phone number
passwd Yes string Login password, length limit: 5 to 16 characters
industry No string Company name

Successful Response JSON Example:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "appId": "$appId",
        "name": "$name",
        "appSecret": "$appSecret",
        "userId": "$userId"
    }
}

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" on success, "error" on failure
message Empty string on success, error description on failure
data.appId User's appId for API calls
data.name User name
data.appSecret User's API key
data.userId User ID

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";
$name = "xxxxx";
$mobile = "1889887777";
$industry="company";
$saleId = "$saleId";
$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'email' => $email,
  'name' => $name,
  'mobile' => $mobile,
  'passwd' => $passwd,
  'industry' => $industry,
  'saleId' =>  $saleId
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "http://api.polyv.net/live/v2/app/add-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;
?>
联系客服,在线咨询