Device Ownership
...
Overview - Device Ownership
OTP Based

Verify OTP

Introduction

Welcome to the API documentation for our Verify OTP service! This powerful API is designed to provide a seamless and secure verification process for one-time passwords (OTP) entered by users. It plays a crucial role in ensuring that the OTPs generated and sent through our Send OTP API are accurately validated, enabling a robust and reliable user authentication flow.

Once the Send OTP API is utilized to deliver the OTP to the user's designated communication channel, the Verify OTP API comes into action. It acts as the final gatekeeper, confirming whether the OTP entered by the user matches the one generated by our system. By performing this crucial step, our API helps maintain a high level of security, protecting sensitive information and user accounts from unauthorized access.

The Verify OTP API is an indispensable tool for applications and services that require a secure authentication mechanism, particularly in scenarios where one-time passwords are utilized to grant access or perform sensitive actions. Through this API, developers can confidently validate user-provided OTPs and grant access only to authorized users, preventing fraudulent activities and safeguarding user data.

In this comprehensive documentation, we will guide you through the integration process, highlighting essential parameters, response codes, and best practices for leveraging the Verify OTP API effectively. Whether you are building a new application or enhancing the security of an existing one, our Verify OTP API is here to empower your authentication workflows with accuracy and reliability. Let's get started and ensure the utmost security for your users!

Sample cURL

Production
Pre-Production
Curl


Request Body Parameters

Parameter Name

Data Type

Required

Description

clientId

String

Yes

A unique identifier for the client.

Please contact Sales administrator to get a unique clientID assigned to you.

phoneNumber

String

Yes

The phone number where the OTP will be sent. It should be in E.164 format with the country code (e.g., +1 for the US). The phone number should be formatted with a "+" sign followed by the country code, a hyphen "-", and then the remaining digits of the phone number.

For example, "+1-9907676111" for the US.

OTP

String

Yes

The OTP (One-Time Password) received by the user via SMS for verification. The OTP should be a string of digits. For example, "840804".

Sample Success Response

OTP is Verified
OTP is invalid
OTP has expired


Success Response Parameters

Parameter Name

Data Type

Description

result

Object

An object containing the result of the OTP verification.

result.verified

Boolean

A boolean value indicating whether the OTP is verified or not. Possible values are "true" if the OTP is verified successfully, and "false" if the OTP verification fails.

result.status

String

The HTTP status code of the request processed by the server.

result.statusDescription

String

A descriptive message indicating the status of the response.

For successful OTP verification, the value is "Success: OTP is Verified".

For expired OTP, the value is "Failure: OTP has expired".

For an invalid OTP, the value is "Failure: OTP is invalid".

Important Points to be noted :-

  1. OTP has validity for 2 minutes. We recommend you to only allow user to re-send OTP after 30-45 seconds in case it is required.
  2. In case multiple OTPs are sent to the user, the latest one is valid for authentication & all previous OTPs will be invalid.
  3. Once the OTP is successfully verified for a user, you can't verify the same OTP again in Verify OTP API.

Sample Error

Invalid Mobile Number
OTP Already Verfied
Resource Not Found
Upstream Down
Unauthorized (401)


Error Response Parameters

Parameter Name

Data Type

Description

error

Object

An object containing details about the error.

error.name

String

The name of the error.

error.message

String

A descriptive error message.

error.status

Number

The HTTP status code of the client request.

error.reason

String

The reason for the error.

error.type

String

The type of error (e.g., "Bad Request").

error.statusCode

Number

The specific status code returned by the server in response to the request, indicating whether the server was able to process the request and provide a response.

Getting help

Please feel free to contact us if you have any questions, require clarification, or have ideas for how to make the documents or any of our services better.

You can reach out to us at [email protected]. We strive to provide prompt and reliable assistance, ensuring your queries are addressed effectively.

We value your feedback and are committed to making your experience smooth and enjoyable. Our team is dedicated to assisting you with any needs you may have. Thank you for choosing our services. We look forward to helping you!