Send SMS, Email Verification Code
POST/auth/v1/verification
API Description
Send phone number or email verification code. Phone number and email are passed according to the verification scenario, and simultaneous passing is not supported.
Prerequisites
- Phone number or email login needs to be enabled on the Cloud Development Platform.
- SMTP server configuration is required for email login.
- x-captcha-token is the verification code token, obtained from the Verify Image Verification Code%8C%E8%AF%81%E5%9B%BE%E7%89%87%E9%AA%8C%E8%AF%81%E7%A0%81) API. It needs to be passed when the API reports captcha_required.
Subsequent Login Process
- If is_user is true, call the login API directly.
- If is_user is null or false, call the registration API to register and then log in.
Request
Header Parameters
Verification code token, obtained from the image verification code interface, needs to be passed when the interface reports captcha_required
- application/json
Body
Valid domestic phone number, needs to be prefixed with "+86 ", e.g., "+86 15588665555"
Valid email, format abc@xxx
Pass ANY, other optional values are USER (account must exist in the system), NOT_USER (account must not exist in the system)
Responses
- 200
Response Headers
- application/json
- Schema
- Example (from schema)
- Example
Schema
Used to pass to the verify SMS, email verification code /auth/v1/verification/verify interface for verification code verification
Determine whether this phone number or email has been registered as a user, returns true if registered
{
"verification_id": "string",
"expires_in": 0,
"is_user": true
}
{
"verification_id": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjlkMWRjMzFlLWI0ZDAtNDQ4Yi1hNzZmLWIwY2M2M2Q4MTQ5OCJ9.eyJlIjoidG9wc29ud2FuZzE2M0AxNjMuY29tIiwiZXhwIjoxNzQ3OTc0MjUxLCJraWQiOiJmY2JlMzBlZC1mNTc3LTRhMDQtOWIyZi05YTI4ZTc0NjA5MzQiLCJwaiI6Imxvd2NvZGUtNWc5YWMyMHUyYTI3ZGE0NiIsInQiOiJBR055Y0hRT0F3NjN4MUhBIn0.lZ_HWAsLDKKswTQONNY1DP9KlvYZK17gFM5ViubWzQDbHyLnOB-H0CtQgDXeDIqN_qKD82HEIst-IpQXefhEjQY1rD1bhUwYxD23MRjl_fQVt-rYbcrM7Ibls0-by6Rqlso7-wR6VrG_TRujHg_ueecw6KbKB5kCfqGXG5AMcjYJFDMQyL1gpNvrJ50lJQdIlBn6S-Hkch_5qGJBnLO9EVtfkmqoPo7-MemiptsyLcN8adWMuhVOG-60NwaF6nLJob62YdV7NTfTfcgAoPB2VKpbITrZvq7LKLA3J2mMz_LDiARl0DcdcxDJOjejgxpWgnz9vvRsmVlcjK8xuoyeZg",
"expires_in": 600
}