<!-- Intent: send the emailmessage with emailcode 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/Email/Send/MY%20Test%20Alert/100000';
$authToken = '123456';

$jsonString = ' 
[{ 
	"EntityName":"Sample Test", 
	"EntityGuid":"952a9bb6-ceac-4f15-9678-ec4e52f564a1", 
        "Email":"test1@swiftreach.com" 
},{ 
	"EntityName":"Sample Test", 
	"EntityGuid":"952a9bb6-ceac-4f15-9678-ec4e52f564a1", 
        "Email":"test2@swiftreach.org" 
}]';

$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