The role of Cognalys in this example is :
Before downloading any example, we recommend you to watch the demonstration video to get an idea about the proper integration of Cognalys API.
// These code snippets use an open-source library. http://unirest.io/php
$response = Unirest::get("https://www.cognalys.com/api/v1/otp/?access_token=<YOUR_ACCESS_TOKEN>&app_id=<YOUR_APP_ID>&mobile=<MOBILE_NUMBER_TO_VERIFY>");
{
"status": "success",
"keymatch": "KEYMATCH_FOR_VERIFYING",
"mobile": "REQUESTED_MOBILE_NUMBER",
"otp_start": "STARTING_OF_OTP"
}
{
"status": "failed",
"mobile": "REQUESTED_MOBILE_NUMBER",
"errors": {
"ERROR_CODE": "ERROR_MESSAGE"
}
}
// These code snippets use an open-source library. http://unirest.io/php
$response = Unirest::get("https://www.cognalys.com/api/v1/otp/confirm/?access_token=<YOUR_ACCESS_TOKEN>&app_id=<YOUR_APP_ID>&otp=<THE_FULL_MISSED_CALL_NUMBER>&keymatch=<THE_KEYMATCH_FROM_FIRST_QUERY>");
{
"status": "success",
"message": "SUCCESS_MESSAGE"
}
{
"status": "failed",
"mobile": "REQUESTED_MOBILE_NUMBER",
"errors": {
"ERROR_CODE": "ERROR_MESSAGE"
}
}