SMS API

Send SMS

Sends an SMS to the list of numbers provided. The message may be a maximum of 160 characters in length and may use a-z, A-Z, 0-9 and these special characters: .,:;!?()~=+-_\/@$#&%.

URL

https://www.callfire.com/cloud/1/sms/send

HTTP Method

POST

Content Type

application/x-www-form-urlencoded

'"Parameters

  • apikey: Required. This is your account api key.
  • message: Required. The message you wish to send.
  • numbers: Required. A CSV of phone numbers

Response

Content-Type = application/xml

<?xml version="1.0" encoding="UTF-8" standalone="yes">
<campaignResponse>
    <campaignid>898085</campaignid>
    <description>Campaign Created</description>
</campaignResponse>

PHP Example

$url = 'https://www.callfire.com/cloud/1/sms/send';
$params = array(
    'apikey'  => $apiKey,
    'message' => 'Hello, SMS!',
    'numbers' => '8182333481,8182333481'
);
$http = curl_init($url);
curl_setopt($http, CURLOPT_POST, true);	
$query = http_build_query($params);
curl_setopt($http, CURLOPT_POSTFIELDS, $query);	
$header = array('Content-Type: application/x-www-form-urlencoded');
curl_setopt($http, CURLOPT_HTTPHEADER,     $header);
curl_setopt($http, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($http, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($http, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($http);
$error = curl_error($http);
if($error != null) 
{
	echo "Error: $error\n";
	throw new Exception($error);
}