Skip to main content

Sign-in verification for OTP

Verify the One-Time Password (OTP) sent to the user's mobile phone and retrieve a valid token.

HTTP Request

POST/api/users/auth/otp/verify

Authorization

Authorization

  • Required: No
  • Permission: None
  • Authentication: None

Request Body

FieldTypeRequiredDescription
codeStringYesOTP code received

Example Requests

1import requests
2
3api = requests.Session()
4response = api.post(
5  'http://www.example.com/api/users/auth/otp/verify/',
6  json={
7      "code": "123456"
8  }
9)

Response Fields

FieldTypeDescription
tokenStringAuthentication token for the user

Example Responses

Successful:

{
"token": "f4e75eab6e0f663a972d145478d6fc4b81762078"
}

Invalid/Expired code:

{
"code": [
"Invalid code."
]
}

Notes

  • The code field must be provided, which is the OTP received by the user.
  • The response will contain an authentication token if the OTP is valid.
  • The token can be used for subsequent authenticated requests by including it in the Authorization header.