Overview
This service is similar to our other verification API in that it allows you to verify a user's telephone number. However with this API, you tell the user the code on your website. We call the user and ask them to input the same code. We then compare the two codes and inform you if they matched or not.
API
API URL http://called.in/api/reverse_verify/
https is also available
GET Parameters - required
api_key: your api_key
phone_number: 10-digit phone number, no spaces or dashes (ex: 5552104427)
country_code: the country code (ex: north america is 1, UK is 44)
code: the security code that we match the user's code with. must be between 1-6 digits (ex: 4345)
callback_url: the URL that we will reply back to (ex: http://site.com/callback.php)
GET Parameters - optional
secret: a string that will be included with the callback. This can be used as an identifier, or to prevent spoofing. Max 30 characters.
caller_id: you can specify the caller id so that the person you are dialing will see your number dialing. The default caller id is '0000000000'
Return Codes
0: success. we will attempt call shortly.
The following are error codes:
1: invalid api_key
2: no call credits
3: the phone_number is on the DoNotCall list
4: badly formed request. make sure all parameters match the above descriptions
5: api_key is currently disabled
6: flood protection for phone_number. please wait 1 minute and try request again
7: phone_number area code is not supported at this time
8: country_code is not supported
Callback Information.
Once a call has been made, and the user has inputted the security code, we will reply to your callback_url with the following
GET parameters
phone_number: the phone_number that you provided, and was dialed
country_code: the country_code that you provided
secret: if you provided a 'secret' string, this will contain the same string. If not, this will be empty.
match: will be '1' if the codes matched, and '0' otherwise.
answered: a value of 0 if we could not connect call, or 1 if the call was answered.
reason: if the call was not answered, the reason will contain one of the following reasons:
0 - Failed (not busy or congested)
1 - Hung up
3 - Ring timeout
5 - Busy
8 - Congestion
Although not required, we recommend you use this feature!
Sample Code
PHP - API Call
<?php
$api_url = 'http://called.in/api/reverse_verify/';
$api_key = 'your_api_key';
$phone_number = '5551234444';
$country_code = '1'; // North America
$code = '3499';
$callback_url = 'http://mysite.com/verify.php';
$secret = 'WeBuildThisCityOnRockAndRoll';
//issue the API call to Called.in
$return_code = file_get_contents("$api_url?api_key=$api_key&phone_number=$phone_number&country_code=$country_code&code=$code&callback_url=$callback_url&secret=$secret");
if($return_code != 0) {
// an error has occurred
//handle it in here
echo $return_code;
}
?>
PHP - API Response
<?php
$saved_secret = 'WeBuildThisCityOnRockAndRoll';
$phone_number = mysql_real_escape_string($_GET['phone_number']);
$country_code = mysql_real_escape_string($_GET['country_code']);
$secret = mysql_real_escape_string($_GET['secret']);
$match = mysql_real_escape_string($_GET['match']);
//spoofing check
if($secret == $saved_secret) {
if($match == 1) {
//user verified phone_number!
//update their account
}
}
?>
Pricing
For pricing information please click here.