Verify Email OTP API
This document highlights the Verify Email OTP API details.
API Description
This document outlines the details of the Verify Email OTP API.
Objective
The Verify Email OTP API authenticates the One-Time Password (OTP) sent to the user's email address using the Send Email OTP API.
API URL
https://ind-engine.thomas.hyperverge.co/v1/verifyOTPEmail
API Endpoint
verifyOTPEmail
Overview
The API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.
Authentication
You need a unique pair of application ID (appId) and application key (appKey) from HyperVerge to verify your identity for accessing the API.
API Request Details
Method - POST
Headers
| Parameter | Mandatory or Optional | Description | Allowed Values |
|---|---|---|---|
| content-type | Mandatory | This parameter defines the media type for the request payload | application/json |
| appId | Mandatory | The application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tab. | This should be a unique value |
| appKey | Mandatory | The application key shared by HyperVerge. You can find the details in the dashboard's credentials tab. | This should be a unique value |
| transactionId | Mandatory | A unique identifier for tracking a user journey | This should be both unique and easily associated with the user's journey in your application(s) |
Inputs
The following table provides the complete information on the parameters used in the request body for the API calls:
| Parameter | Description | Mandatory or Optional | Allowed Values | Default Value |
|---|---|---|---|---|
reqId | The message result returned by Send Email OTP API | Mandatory | Not Applicable | Not Applicable |
otp | The OTP sent to the user's email by the Send Email OTP API | Mandatory | Not Applicable | Not Applicable |
email | The user's email address | Optional | Not Applicable | Not Applicable |
widgetId | The Widget ID for a custom email template. If this is not passed, the default email template with HyperVerge branding will be sent | Optional | Not Applicable | The widgetId from HyperVerge |
Request
The following code shows a standard cURL request for the API:
curl --location --request POST 'https://ind-engine.thomas.hyperverge.co/v1/verifyOTPEmail' \
--header 'Content-Type: application/json' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--data '{
"reqId": "<Enter_the_Request_ID>",
"otp": "<Enter_the_OTP_received>",
"email": "<Enter_the_Email_ID>",
"widgetId": "<Enter_the_Widget_ID>"
}'
Success Response
The following is a success response from the API:
{
"status": "success",
"statusCode": 200,
"result": {
"status": "success",
"message": "<Message_String>"
},
"metaData": {
"requestId": "<Request_ID>"
}
}
Success Response Details
| Parameter | Type | Description |
|---|---|---|
| message | String | A token, often encoded in a specific format, containing information used for verification or further actions |
Error Responses
- OTP Verified
- OTP Expired
- Invalid OTP
- Missing/Invalid credentials
- Internal Server Error
{
"status": "failure",
"statusCode": 200,
"error": {
"message": "otp already verifed"
},
"metaData": {
"requestId": "<Request_ID>"
}
}
{
"status": "failure",
"statusCode": 200,
"error": {
"message": "OTP has expired"
},
"metaData": {
"requestId": "<Request_ID>"
}
}
{
"status": "failure",
"statusCode": 200,
"error": {
"message": "invalid otp"
},
"metaData": {
"requestId": "<Request_ID>"
}
}
{
"message": "Missing/Invalid credentials",
"statusCode": 401,
"status": "failure"
}
{
"statusCode": 500,
"status": "failure",
"error": "Internal Server Error"
}
Error Response Details
failure status, with a relavant status code and error message. The following table lists all error responses. | Status Code | Error Message | Error Description |
|---|---|---|
| 400 | Missing required request parameters | Some mandatory request parameters are missing in the API request made or the parameter has already been passed |
| 401 | Missing/Invalid credentials | The request is either missing the mandatory appId and appKey combination or has invalid values |
| 403 | Access Denied | Please contact the HyperVerge team for resolution |
| 429 | Rate limit exceeded | You have exceeded the configured limit on the number of transactions permitted in a minute. Please contact the HyperVerge team for resolution |
| 500 | Internal Server Error | Please check the request headers or contact the HyperVerge team for resolution |