Overview
This service allows you to easily call a given number, and playback an mp3 file. This is a simple way to integrate automated calling into your products.
API
API URL http://called.in/api/playback/
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)
mp3: URL where the playback mp3 is found (ex: http://site.com/greeting.mp3)
GET Parameters - optional
cache: allow the mp3 file to be cached locally? either 'True' or 'False'. default is True.(ex: cache=False)
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'
callback_url: URL that we will reply back to (see below)
secret: a string that will be included with the callback. This can be used as an identifier, or to prevent spoofing. Max 30 characters.
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
9: mp3 is an invalid MPEG-3 file
10: mp3 is too long. max length is 3 minutes.
Callback Information.
If a callback_url is provided, we will open the URL with the following GET parameters
secret: if you provided a 'secret' string, this will contain the same string. If not, this will be empty.
phone_number: the caller_phone_number that you provided, and was dialed
country_code: the callee_phone_number that you provided, and was dialed
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
<?php
$api_url = 'http://called.in/api/playback/';
$api_key = 'your_api_key';
$phone_number = '5551234444';
$country_code = '1'; // North America
$mp3 = urlencode('http://mysite.com/welcome.mp3');
//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&mp3=$mp3");
if($return_code != 0) {
// an error has occurred
//handle it in here
echo $return_code;
}
?>
Pricing
For pricing information please click here.