Generate and Validate OTP Service

The Generate and Validate OTP (One-Time Password) API Service is a secure and convenient solution for implementing multi-factor authentication in your applications. This API allows you to generate unique OTPs and validate them, enhancing the security of user accounts and transactions.

Endpoint

Headers

  • Name
    contentType
    Type
    string
    Description

    This should be set to application/json.

  • Name
    apiKey
    Type
    string
    Description

    Find your API key under your login account.

POST

Generate OTP

This endpoint facilitates the generation of a One-Time Password (OTP). Upon successful invocation, a unique OTP is provided, enhancing the security of your system. By default, the OTP is designed for single-use and expires after a specified timeframe. Implementing this feature adds an additional layer of authentication to your application, bolstering overall security

Required attributes

  • Name
    config-id
    Type
    string
    Description

    ID of the verification configuration based on which the OTP will be generated.

  • Name
    to
    Type
    string
    Description

    Recipient’s MSISDN

Request

POST
 curl -G - /v1/verify \
  -H 'apiKey':'string'
  -H "Content-Type: application/json" \
  -d '{
     "configId": " a73cd9xe-XXXX-XXXX-XXXX-7f731bcf4y64",
     "to": "91XXXXXXXXXX " }'

Response

  {
      "data": "33888968-XXXX-XXXX-XXXX-3010e0069668",
      "error": null,
      "message": "OTP Generated Successfully!"
  }

POST

Verify OTP

This endpoint verifies a user-submitted One-Time Password (OTP), confirming their identity for secure access. Successful validation grants authorized users access to the intended functionality, bolstering system security by ensuring only valid OTPs are accepted.

Required attributes

  • Name
    verifyId
    Type
    string
    Description

    The Verify ID which was sent in the Generate OTP API response.

  • Name
    otp
    Type
    string
    Description

    One Time Password which was sent to the users to validate them.

Request

POST
 curl -G - /v1/verify/validate \
  -H 'apiKey':'string'
  -H "Content-Type: application/json" \
  -d '{
     "verifyId": "33888968-XXXX-XXXX-XXXX-3010e0069668",
     "otp": "XXXXXX" }'

Response

{
    "data": "33888968-XXXX-XXXX-XXXX-3010e0069668",
    "error": null,
    "message": "OTP Verified Successfully!"
}

Was this page helpful?