This API verifies a pair of token and OTP (One Time Password).
The API returns true if:
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
Name | Type | Description | Default |
apiKey | String | Mandatory. The apiKey that gives you access to our HTTP APIs. The apiKey authenticates you and helps us to identify your Juvlon account. | |
token | String | The token provided when the OTP was generated. | num |
otp | String | The OTP that your user provides for verification. | 4 |
Return values
Name | Type | Description |
code | String | The Success or Error response code as returned by the API. Please refer to the section “Possible-Response-Codes” for more details. |
status | String | Description of the error code returned. |
transactionId | String | A number generated by the API to uniquely identify the current call. Also known as the API_Call_ID. |
verify | Boolean | The 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. |
token | String | The token that was sent for verification. |
OTP | String | The 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