Skip to main content

Register

The register API is used to create an account on the LI PASS system using an account and password.

Request parameters​

ParametersTypeDescriptionNote
accountstringAccount
Email or phone number (phones currently not supported)
Required
account_typenumberAccount type
1: Email
2: Phone number (currently not supported)
Required
phone_area_codestringPhone Area CodeRequired if account_type is 2
passwordstringUser password.For more details, see Password Rules.Required
user_namestringUnique username used for login, cannot be duplicated.For more information, see Username Rules.Optional
nick_namestringUser nickname for display purposes, can be duplicatedOptional
birthdaystringUser's birthday
YYYY-MM
Optional
regionstringNumeric codes of countries or regions as per ISO 3166-1
For example, 156 represents China, and 040 represents Austria.
Optional
is_receive_emailnumberEmail notifications
1: Send
Other: Do not send
Optional
verify_codestringVerification codeControlled by Player Network login configuration
user_lang_typestringLanguage Type
For details, refer to Language Type Definition。
Optional
machine_check_typenumberThis field is currently unavailable, please ignore.
CAPTCHA type
3: Tencent CAPTCHA
Required when machine check is enabled in Player Network settings
tencent_responsestringTencent 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​

ParametersTypeDescription
retnumberReturn code
0: Request successful
!=0: Request failed, refer to msg for detailed results
msgstringResult Explanation
tokenstringUser authorization token
uidstringLI PASS UID
seqstringData Stream Message Serial Number
expireint64Token Expiration Time
Unix Time

Response sample​

{
expire: 1639096606
msg: "Success"
ret: 0
seq: "1638796606-0180225310-009909-0000096176"
token: "xxxx@o@j1HBUIpXeuaGv9WdmW1eTpdEA=="
uid: "xxxxx"
}