Skip to main content

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

    x-captcha-token string

    Verification code token, obtained from the image verification code interface, needs to be passed when the interface reports captcha_required

Body

    phone_number Phone Number (string)

    Valid domestic phone number, needs to be prefixed with "+86 ", e.g., "+86 15588665555"

    email Email (string)

    Valid email, format abc@xxx

    target Target for sending verification code (string)required

    Pass ANY, other optional values are USER (account must exist in the system), NOT_USER (account must not exist in the system)

Responses

Response Headers
    Schema
      verification_id Verification Code ID (string)

      Used to pass to the verify SMS, email verification code /auth/v1/verification/verify interface for verification code verification

      expires_in Verification code expiration time, in seconds (integer)
      is_user User Exists (boolean)

      Determine whether this phone number or email has been registered as a user, returns true if registered

    Loading...