Skip to main content

Send OTP API

This document outlines the details of the Send Mobile OTP API.

API Description

Objective

The Send Mobile OTP API shares a one-time password (OTP) to the user's phone for verification.

InputOutput
The user's mobile number and the unique identifier for your organizationThe API sends an OTP to the user's email and returns a relevant JSON response

API URL

https://ind-engine.thomas.hyperverge.co/v1/verifyMobileSendOtp

API Endpoint

verifyMobileSendOtp

API Request Details

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.

Method - POST

Headers

ParameterMandatory or OptionalDescriptionAllowed Values
content-type MandatoryThe media type for the request payload.application/json
appId MandatoryThe application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value.
appKey MandatoryThe application key shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value.
transactionIdMandatoryA 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

ParameterDescriptionMandatory or OptionalAllowed ValuesDefault Value
templateIdThe unique template identifier assigned to your organization and format by HyperVergeMandatoryNot Applicable - This should be a unique valueNot Applicable
mobileNumberThe ten-digit mobile number of the user based in IndiaMandatoryA valid ten-digit phone numberNot Applicable
otpLengthThe number of digits in the OTP definitionOptionalAny number between 4 and 94
otpExpiryThe OTP expiry duration in minutes (default: 24 hours, max: 7 days, min: 1 minute)OptionalAny value between the minimum and maximum range. Minimum: 1 minute and Maximum : 10080 minutes (7 days)1440 (24 hours)
timeThe time duration value for OTP expiry as required (used in combination with timeFormat), to be send along with the OTP messageOptionalNot ApplicableNot Applicable
timeFormatThe time unit format for OTP expiry duration (e.g., "minutes", "mins")OptionalNot ApplicableNot Applicable
showLastFourDigitsWhether to show the last four digits of the mobile number in the OTP messageOptional"yes" or "no""no"

Request

The following is a standard cURL request for the API:

curl --location --request POST 'https://ind-engine.thomas.hyperverge.co/v1/verifyMobileSendOtp' \
--header 'Content-Type: application/json' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--data '{
"templateId": "<Enter_the_Unique_Template_Identifier_from_HyperVerge>",
"mobileNumber": "<Enter_the_Mobile_Number_of_the_User_for_Verification>",
"otpLength": "<Enter_the_OTP_length>",
"otpExpiry": "<Enter_the_OTP_Expiry_Duration>",
"time":"<Enter_the_time_duration>",
"timeFormat":"<Enter_the_required_time_format>",
"showLastFourDigits":"<Enter_yes_or_no>"
}'

Success Response

The following is a successful response sample:

{
"status": "success",
"statusCode": 200,
"metaData": {
"requestId": "<Request_Identifier>"
}
}

Failure Response

{
"statusCode": 200,
"status": "failure",
"error": {
"message": "OTP not match",
"type": "error"
},
"metaData": {
"requestId": "<Request_Identifier>"
}
}

Error Responses

{
"message": "Input Validation Error: does not meet minimum length of 4",
"statusCode": 400,
"status": "failure"
}

Failure and Error Response Details

A failure or error response from the module contains a failure status, with a relavant status code and error message.

The following table lists all error responses:


Status CodeError MessageError Description
400This error is returned when 'image' is not sent in the API callThis error is returned when more than 2 images are sent in the API call
400API call handles only upto 2 imagesThis error is returned when more than 2 images are sent in the API call
400image size cannot be greater than 6MBThe maximum size of input image is 6MB. Crossing this will result in this error
429Rate limit exceededYou have exceeded the configured limit on the number of transactions permitted in a minute. Please contact the HyperVerge team for resolution
500/501Internal Server ErrorPlease check the request headers or contact the HyperVerge team for resolution
503Server busyPlease contact the HyperVerge team for resolution
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: