1. Home
  2. Docs
  3. API Documentation
  4. Active APIs
  5. verifyOneTimeCode

verifyOneTimeCode

This API verifies a pair of token and OTP (One Time Password).

The API returns true if:

The token and OTP match,
The OTP has not expired, and
The OTP has not been verified/used before.

This API needs to be called using an HTTP Post method with data in JSON format as shown below.

URL: https://api2.juvlon.com/v4/verifyOneTimeCode

JSON Parameters
'{"apiKey":"$apiKey",
"token":"$token",
"otp":"$otp"
}';

Arguments

NameTypeDescriptionDefault
apiKeyStringMandatory. The apiKey that gives you access to our HTTP APIs. The apiKey authenticates you and helps us to identify your Juvlon account. 
tokenStringThe token provided when the OTP was generated. num
otpStringThe OTP that your user provides for verification. 4

Return values

NameTypeDescription
codeStringThe Success or Error response code as returned by the API. Please refer to the section “Possible-Response-Codes” for more details.
statusStringDescription of the error code returned.
transactionIdStringA number generated by the API to uniquely identify the current call. Also known as the API_Call_ID.
verifyBooleanThe verification status of the token-OTP pair.

true – If the token-OTP pair is correct, not expired and not verified before.

false – If the token-OTP pair is incorrect, or expired, or verified before.
tokenStringThe token that was sent for verification.
OTPStringThe OTP that was sent for verification.

Usage / Example(s)

PHP Example Code for Integration

$url = 'https://api2.juvlon.com/v4/verifyOneTimeCode';
$data = '{"apiKey":"KEY",
"token":"OJUWLB",
"otp":"9078"
}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$res1 = curl_exec($ch);
curl_close($ch);

Success-Response

HTTP/1.1
{
"code":200,
"status":"Success",
"transactionId":"327",
"verify":"true",
"token":"OJUWLB",
"OTP":"9078"
}

Error-Response

 HTTP/1.1
{
"code":442,
"status":"Error"
}

Possible-Response-Codes

200    Success: API Request Accepted
401 Error:Invalid Method
402 Error: Unauthorized/Empty Key
403 Error: Unauthorized/Invalid Key
404 Error: Account Sending Blocked