Skip to main content

RequestVerifyCode

The requestVerifyCode API is used to send the verification code to a user's email or phone. This API should be used for any verification code related cases.

Request Parameter

ParameterTypeDescriptionRemark
accountstringAccount
Email or phone number (currently not supported)
Required
account_typenumberAccount type
1: Email
2: Phone number (currently not supported)
Required
phone_area_codestringPhone area codeRequired when account_type is 2
code_typenumberVerification code type
0: Register
1: Reset password
2: Register and login
3: Modify the registered account
only_login_typenumber0: Automatically register if account does not exist
1: Login only
Optional
machine_check_typenumberCAPTCHA type
3: Tencent Captcha
Required when CAPTCHA is configured on Player Network
tencent_responsestringTencent Captcha response value
Converts the value to string, for example, JSON.stringify({"appid":"xxx","ret":0, "ticket":"t030...ECE*","randstr":"@BHo"}).
Required when machine_check_type is 3

Request Sample

accountApi.requestVerifyCode(
{
account:'xxx@gmail.com',
account_type:1,
code_type:0
}
).then((res) => {
console.log(res);
});

Response Parameter

ParameterTypeDescription
retnumberReturn code
0: Request success
!=0: Request failure, see msg for detailed return message
msgstringReturn message
seqstringSequence number of the message in the data stream
expireint64Expiration time of the token
Unix time

Response Sample

{
expire_time: 179998
msg: "Success"
ret: 0
seq: "1638242466-0180225865-009373-0000004742"
}