Retrieve An otp code
Retrieve a specific otp code details
HTTP Request
GET/api/notifications/otp/:id
Authorization
Authorization
- Required: Yes
- Permission: Staff with OTPPermission or Admin
- Permission Code: 2852
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | Integer | Yes | Unique ID of the otp code |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2response = requests.get('http://www.example.com/api/notifications/otp/64', headers={
3 'Authorization': 'Token <your_api_key>'
4})
5
6print(response.json())1curl
2curl -X GET "http://www.example.com/api/notifications/otp/64" -H "Authorization: Token <your_api_key>"Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the otp code. |
| code | Integer | The otp code |
| mobile_number | String | The related mobile number (nullable, valid iranian mobile number) |
| String | The related email address (nullable, valid email format) | |
| recipient | String | The receiver of the otp code (either email or mobile number, calculated field) |
| valid_to | String (ISO 8601) | Timestamp when the otp code will be expired. |
| ttl | Integer | The duration in seconds which the otp code will be valid (calculated field) |
| is_allow | Boolean | Whether the otp code is still valid and usable or not (calculated field) |
| created_at | String (ISO 8601) | Timestamp when the otp code was created. |
| updated_at | String (ISO 8601) | Timestamp when the otp code was last updated. |
Response Example
{
"id": 57,
"code": 255315,
"mobile_number": "09123256545",
"email": null,
"recipient": "09123256545",
"valid_to": "2025-12-30T14:40:08.268800Z",
"ttl": 85787,
"is_allow": true,
"created_at": "2025-12-29T14:38:32.273219Z",
"updated_at": "2025-12-29T14:38:32.273223Z"
}