Table of Contents
Verify one-time-password from user supplied data. Requires “otp” API permission.GET https://androidapi.net/api/get/otp
Parameter #
Field | Type | Description |
---|---|---|
secret | String | The API secret you copied from (Tools -> API Keys) page |
otp | String | The otp you got from a user supplied input or data |
Success Response Format #
Field | Type | Description |
---|---|---|
status | Number | List of Codes 200 = Success |
message | String | Response message |
data | Array | Array of data |
Error Response Format #
Name | Type | Description |
---|---|---|
status | Number | List of Codes 400 = Invalid parameters 401 = Invalid API secret 403 = Access denied 500 = Something went wrong |
message | String | Response message |
data | Array | Array of data |
PHP Sample #
<?php
$apiSecret = "API_SECRET"; // your API secret from (Tools -> API Keys) page
$otp = "123456"; // otp from a user supplied input or data
$cURL = curl_init();
curl_setopt($cURL, CURLOPT_URL, "https://androidapi.net/api/get/otp?secret={$apiSecret}&otp={$otp}");
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($cURL);
curl_close($cURL);
$result = json_decode($response, true);
// do something with response
print_r($result);
Python Sample #
import requests
# your API secret from (Tools -> API Keys) page
apiSecret = "API_SECRET"
# otp from a user supplied input or data
otpCode = "123456"
r = requests.get(url = "https://androidapi.net/api/get/otp", params = {
"secret": apiSecret,
"otp": otpCode
})
# do something with response object
result = r.json()
Successful Response #
{
"status": 200,
"message": "OTP has been verified!",
"data": false
}
Error Response #
{
"status": 403,
"message": "OTP is invalid or expired!",
"data": false
}