Validate OTP
Validate OTP API
This API is used to validate the OTP received by the user when a notification of type OTP
is generated using the generateRVN
API.In case of msg_type = "OTP"
, REL-IDverify server generates the OTP and sends a push notification to the user.
The user types in the OTP on the transaction web page. The web page then calls the validateOTP
API to validate the OTP value provided by the user.
🔗 Endpoint
POST https://REL-ID-VERIFY-SERVER:VERIFY-PORT/validateOTP.htm
🔐 Authentication
Use one of the following in the request headers:
- Basic Auth:
Authorization: Basic <base64-encoded-credentials>
- OAuth2 Token:
Authorization: Bearer <access_token>
📤 Request Headers
Header | Value | Required |
---|---|---|
Authorization | Basic / Bearer Token | ✅ |
Content-Type | application/json | ✅ |
📨 Request Body
{
"notification_uuid": "<UUID from generateRVN>",
"otp_value": "<User entered OTP>"
}
notification_uuid
: (string) Unique ID received ingenerateRVN
response.otp_value
: (string) OTP value entered by user. It should match the hashed value as per thehash_spec
used during generation.
📥 Success Response (Validation Success)
{
"response_code": 0,
"notification_uuid": "03f67f9e-ec4f-11e6-b006-92361f002671",
"otp_validation_status": "SUCCESS"
}
📥 Failure Response (Validation Failed)
{
"response_code": 0,
"notification_uuid": "03f67f9e-ec4f-11e6-b006-92361f002671",
"otp_validation_status": "FAILED",
"attempts_left": 2
}
❌ Error Response (API Error)
{
"response_code": 1,
"error_code": 3565,
"error_message": "Notification is not present or is expired"
}
⚠️ Error Codes
Code | Message | Cause |
---|---|---|
2600 | INVALID URI | Invalid endpoint URL |
2607 | Invalid http request | Incorrect HTTP format |
2699 | Internal Server error | Server-side error |
3502 | Invalid Notification Request Data | Malformed or missing notification UUID |
3564 | OTP Value is null or empty | Empty OTP provided |
3565 | Notification is not present or is expired | Expired or invalid notification UUID |
3572 | Not allowed on TWO-WAY notification | API called for a TWO-WAY type notification |
3575 | Validate OTP attempts exhausted | OTP retries exhausted |
3593 | notification-uuid regex validation failed | Invalid UUID format |
7014 | Invalid request | Required parameters missing |
7019 | IPAddress is not whitelisted | IP not allowed by server firewall |
Updated 3 months ago