Skip to main content

User Login API

POST 

/auth/v1/signin

Login Scenarios Explanation

1. Username/Password Login

Input Requirements:

  • username: Username (required, 2-48 characters, supports English letters (case-sensitive), numbers, special characters (only -_.:+ @), must start with a letter or number, Chinese characters not supported)
  • password: Password (required)

Prerequisites:

  • Registered users can use username/password login

Username/Password Login Request Example

{
"username": "zhangsan",
"password": "example password"
}

Username/Password Login Response Example

{
"token_type": "Bearer",
"access_token": "your_access_token",
"refresh_token": "m.aB3cD4eF5gH6iJ7kL8mN9oP0qR1sT2uV3wX4yZ5aB6cD7eF8gH9iJ0kL1mN2oP3qR4sT5uV6wX7yZ8",
"expires_in": 7200,
"sub": "9876543210123456789"
}

2. Phone Number Verification Code Login

Input Requirements:

Prerequisites:

  • Need to call verification code sending API first to get verification code
  • Get verification_token after verification code validation passes

Phone Number Verification Code Login Request Example

{
"verification_token": "your_verification_token"
}

Phone Number Verification Code Login Response Example

{
"token_type": "Bearer",
"access_token": "your_access_token",
"refresh_token": "m.aB3cD4eF5gH6iJ7kL8mN9oP0qR1sT2uV3wX4yZ5aB6cD7eF8gH9iJ0kL1mN2oP3qR4sT5uV6wX7yZ8",
"expires_in": 7200,
"sub": "9876543210123456789"
}

3. Email Verification Code Login

Input Requirements:

Prerequisites:

  • Need to call email verification code sending API first to get verification code
  • Get verification_token after verification code validation passes

Email Verification Code Login Request Example

{
"verification_token": "your_verification_token"
}

Email Verification Code Login Response Example

{
"token_type": "Bearer",
"access_token": "your_access_token",
"refresh_token": "m.aB3cD4eF5gH6iJ7kL8mN9oP0qR1sT2uV3wX4yZ5aB6cD7eF8gH9iJ0kL1mN2oP3qR4sT5uV6wX7yZ8",
"expires_in": 7200,
"sub": "9876543210123456789"
}

General Notes:

  • The three login methods are mutually exclusive, only one method can be used per request
  • For verification code login, need to obtain verification_token from Verify SMS/Email Verification Code API
  • Returns standard token response after successful login

Request

Responses

Response Headers