Skip to main content

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

ParameterTypeRequiredDescription
idIntegerYesUnique ID of the otp code

Example Requests

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())

Response Fields

FieldTypeDescription
idIntegerUnique ID of the otp code.
codeIntegerThe otp code
mobile_numberStringThe related mobile number (nullable, valid iranian mobile number)
emailStringThe related email address (nullable, valid email format)
recipientStringThe receiver of the otp code (either email or mobile number, calculated field)
valid_toString (ISO 8601)Timestamp when the otp code will be expired.
ttlIntegerThe duration in seconds which the otp code will be valid (calculated field)
is_allowBooleanWhether the otp code is still valid and usable or not (calculated field)
created_atString (ISO 8601)Timestamp when the otp code was created.
updated_atString (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"
}