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
| Field | Type | Required | Description |
|---|---|---|---|
| code | String | Yes | OTP code received |
Example Requests
- 🐍 Python
- 🌐 Curl
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)1curl "http://www.example.com/api/users/auth/otp/verify/" -X POST -H "Content-Type: application/json" -d '{
2 "code": "123456"
3}'Response Fields
| Field | Type | Description |
|---|---|---|
| token | String | Authentication token for the user |
Example Responses
Successful:
{
"token": "f4e75eab6e0f663a972d145478d6fc4b81762078"
}
Invalid/Expired code:
{
"code": [
"Invalid code."
]
}
Notes
- The
codefield 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
Authorizationheader.