Verify OTP SMS Bulk SMS API Documentation

Verify OTP SMS

Verify OTP Token.

Application API URL:

https://www.smsgateway.center/OTPApi/send

 

Import Verify OTP SMS API postman collection.

Postman Collection

 

 

Key Value Description
Login Credentials (Required Parameters)
Authenticate your API request using userId-password or apiKey. You should use either one to authenticate your login.
userId Your Registered Username The registered username parameter to be passed. You can use this if apiKey is not being used.
password Your password The password needs to be urlencoded if there are any special characters used in the password field. You can use this if apiKey is not being used.
apiKey Your unique apiKey apiKey needs to be sent as HTTP header when you are not using userId and password credentials. You can avail this from your user control panel and use instead of userId and password HTTP Request parameter. Please do not disclose this to anyone.
Required Parameters
mobile Mobile Number with Country Code Required. Enter your Customer's mobile number which needs to be verified.

Comments: Keep number in International format (with country code).
otp Sent OTP Code Required. Send the code to verify which was delivered to recipient.

Comments: Verify OTP Token of the recipient.
sendMethod verify

Required: This value required for verification of OTP code which was inputted by the recipient.

format plain|json|xml Value for response format.

System default is plain. If you need responses in JSON or XML then you have to give value as JSON or XML.

Save this Page on your Favorite Social Media

Sample Request Code

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.smsgateway.center/OTPApi/send",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "userId=YourUserName&password=YourPassword&mobile=91xxxxxxxxxx&otp=668386&sendMethod=verify&callback=http%3A%2F%2Fwww.example.com%2FgetOTPResponse.php&format=json",
  CURLOPT_HTTPHEADER => array(
    "Cache-Control: no-cache",
    "Content-Type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.smsgateway.center/OTPApi/send?userId=YourUserName&password=YourPassword&mobile=91xxxxxxxxxx&otp=668386&sendMethod=verify&callback=http://www.example.com/getOTPResponse.php&format=json",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Cache-Control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Response - Success

{
    "status": "success",
    "mobile": "91xxxxxxxxxx",
    "transactionId": "74c286ad-8a74-4dcd-a2dd-6c936a95037b",
    "statusCode": "900",
    "reason": "OTP has been Verified Successfully."
}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<simpleMessageSuccessResponse>
    <mobile>91xxxxxxxxxx</mobile>
    <status>success</status>
    <statusCode>900</statusCode>
    <reason>OTP has been Verified Successfully.</reason>
    <transactionId>2f8e3c68-2b6d-4125-b1f3-8d7914ae2530</transactionId>
</simpleMessageSuccessResponse>
status=success | mobile=91xxxxxxxxxx | reason=OTP has been Verified Successfully. |  transactionId=c30ec631-afcc-4810-ad01-372242df9c40 | errorCode=900

Response - Error

{
    "status": "error",
    "statusCode": "952",
    "reason": "OTP token is already verified."
}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<errorResponse>
    <status>error</status>
    <statusCode>952</statusCode>
    <reason>OTP token is already verified.</reason>
</errorResponse>
status=error | errorCode=952 | reason=OTP token is already verified.