Register
The register API is used to create an account on the LI PASS system using an account and password.
Request parameters
| Parameters | Type | Description | Note |
|---|---|---|---|
| account | string | Account Email or phone number (phones currently not supported) | Required |
| account_type | number | Account type 1: Email 2: Phone number (currently not supported) | Required |
| phone_area_code | string | Phone Area Code | Required if account_type is 2 |
| password | string | User password.For more details, see Password Rules. | Required |
| user_name | string | Unique username used for login, cannot be duplicated.For more information, see Username Rules. | Optional |
| nick_name | string | User nickname for display purposes, can be duplicated | Optional |
| birthday | string | User's birthday YYYY-MM | Optional |
| region | string | Numeric codes of countries or regions as per ISO 3166-1 For example, 156 represents China, and 040 represents Austria. | Optional |
| is_receive_email | number | Email notifications 1: Send Other: Do not send | Optional |
| verify_code | string | Verification code | Controlled by Player Network login configuration |
| user_lang_type | string | Language Type For details, refer to Language Type Definition。 | Optional |
| machine_check_type | number | This field is currently unavailable, please ignore. CAPTCHA type 3: Tencent CAPTCHA | Required when machine check is enabled in Player Network settings |
| tencent_response | string | Tencent CAPTCHA response value Convert value to string, e.g. JSONstringify({"appid":"xxx","ret":0, "ticket":"t030...ECE*","randstr":"@BHo"}) | Required when machine_check_type is 3 |
Request sample
accountApi.register(
{
verify_code: '12345',
account:'lhmtyn47025@chacuo.net',
account_type: 1,
password:'xxxx',
user_name: 'lhmtyn47025',
nick_name: 'lhmtyn47025',
birthday:'2000-01',
region:'156',
user_lang_type: 'en',
is_receive_email: 0,
}
).then((res) => {
console.log(res);
});
Response parameters
| Parameters | Type | Description |
|---|---|---|
| ret | number | Return code 0: Request successful !=0: Request failed, refer to msg for detailed results |
| msg | string | Result Explanation |
| token | string | User authorization token |
| uid | string | LI PASS UID |
| seq | string | Data Stream Message Serial Number |
| expire | int64 | Token Expiration Time Unix Time |
Response sample
{
expire: 1639096606
msg: "Success"
ret: 0
seq: "1638796606-0180225310-009909-0000096176"
token: "xxxx@o@j1HBUIpXeuaGv9WdmW1eTpdEA=="
uid: "xxxxx"
}