Overview and parameters

Validate OTP Via HTTP Request:

Parameters Detail:

Parameter Value (Sample) Required Description
apikey 54XXXXXXXXXXXXX Mandatory Assigned API key of user. This key user can get from portal by logging into the system.
otp 587525 Mandatory Generated OTP will be input for verify it.
mobileNo 874xxxx587 Mandatory Mobile number on which message will be delivered.

Error Codes -

Sr No Error Code Error Status
1 -101 Unknown
2 000 Success
3 001 Required
4 002 Invalid
5 003 Failed
6 004 Duplicate

Request reference

POST request

POST https://{Domain}/client/api/otp/validate/{apiKey}/{otp}/{mobileNo}

Code examples

Code example
curl --location --request POST 'https://{Domain}/client/api/otp/validate/{apiKey}/{otp}/{mobileNo}' \
  --header 'Content-Type: application/json' \
  --data-raw '{
"api-key":"f06xxxxxdx2a6",
"mobile-no":"985xxxx542",
"otp":"UxxH"
}'
const url = "https://{Domain}/client/api/otp/validate/{apiKey}/{otp}/{mobileNo}";
const options = {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
"api-key":"f06xxxxxdx2a6",
"mobile-no":"985xxxx542",
"otp":"UxxH"
})
};

const response = await fetch(url, options);
const data = await response.json();
console.log(data);
import requests

url = "https://{Domain}/client/api/otp/validate/{apiKey}/{otp}/{mobileNo}"
headers = {
    "Content-Type": "application/json"
}
payload = '''{
"api-key":"f06xxxxxdx2a6",
"mobile-no":"985xxxx542",
"otp":"UxxH"
}'''

response = requests.request(
    "POST",
    url,
    headers=headers,
    data=payload
)
print(response.json())
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://{Domain}/client/api/otp/validate/{apiKey}/{otp}/{mobileNo}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => <<<'JSON'
{
"api-key":"f06xxxxxdx2a6",
"mobile-no":"985xxxx542",
"otp":"UxxH"
}
JSON,
    CURLOPT_HTTPHEADER => [
    "Content-Type: application/json"
    ]
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;

Request body

JSON body
{
"api-key":"f06xxxxxdx2a6",
"mobile-no":"985xxxx542",
"otp":"UxxH"
}

Response example

JSON response
{
"mobile-no": "+9198xxxxx542",
"status":
{
"error-code": "000",
"error-status": "Success",
"error-description": "OTP Validate Successfully"
}
}

GET request

GET https://{Domain}/client/api/otp/validate/{apiKey}/{otp}/{mobileNo}

Code examples

Code example
curl --location --request GET 'https://{Domain}/client/api/otp/validate/{apiKey}/{otp}/{mobileNo}'
const url = "https://{Domain}/client/api/otp/validate/{apiKey}/{otp}/{mobileNo}";
const options = {
  method: "GET"
};

const response = await fetch(url, options);
const data = await response.json();
console.log(data);
import requests

url = "https://{Domain}/client/api/otp/validate/{apiKey}/{otp}/{mobileNo}"
headers = {}

response = requests.request(
    "GET",
    url,
    headers=headers
)
print(response.json())
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://{Domain}/client/api/otp/validate/{apiKey}/{otp}/{mobileNo}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "GET"
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;

Request body

JSON body
{
"api-key":"f0xxxxexxxxa6",
"mobile-no":"985xxxx542",
"otp":"UxxH"
}

Response example

JSON response
{
"mobile-no": "+91985xxxx542",
"status": {
"error-code": "000",
"error-status": "Success",
"error-description": "OTP Validate Successfully"
}
}