<!-- Intent: send the sms message with smscode of 100000 to
	an array of contacts posted in the body of the request
	and name the alert "My Test Alert"
	-->


<?php
$url = 'http://api.v4.swiftreach.com/api/Messages/Text/Send/MY%20Test%20Alert/100000';
$authToken = '123456';


$jsonString = ' 
[{ 
"EntityName":"Sample Test", 
"EntityGuid":"952a9bb6-ceac-4f15-9678-ec4e52f564a1", 
"Phones":[{ 
                 "Phone":"9085551212", 
                 "Extension":"", 
                 "AnsDetectionOverride":0, 
                 "OptInSMS":true, 
                 "PhoneType":0, 
                 "PhoneLabel":"Mobile" 
                },{ 
                 "Phone":"7025551212", 
                "Extension":"", 
                "AnsDetectionOverride":0, 
                "OptInSMS":true, 
                "PhoneType":0, 
                "PhoneLabel":"Phone" 
               }] 
}]';

$headers = array(
    'Content-type: application/json',
    'SwiftAPI-Key: ' . $authToken,
    'Accept: application/json',
    'Expect:'
);
$ch = curl_init();
$args = array(
    CURLOPT_URL => $url,
    CURLOPT_FOLLOWLOCATION => TRUE,
    CURLOPT_RETURNTRANSFER => TRUE,
    CURLOPT_POST => TRUE,
    CURLOPT_POSTFIELDS => $jsonString,
    CURLOPT_HTTPHEADER => $headers,
);
curl_setopt_array($ch, $args);
$res = curl_exec($ch);
$res_data = json_decode($res, true);
print($res_data);
?>

<!-- example return value -->
123456