<!-- Intent: creates a new scheduled alert to send sms 660197 to contact list 668447 --> <?php $url = 'http://api.v4.swiftreach.com/api/Alerts/Schedules/Create'; $authToken = '123456'; $jsonString = ' { "$type":"API.V4.DataWrappers.Schedule_Run_Once, API.V4", "IsActive":false, "ScheduleType":0, "TaskDateTime":"4/2/2015 12:00 PM", "TaskName":"My Scheduled Alert 2", "Description":"Example of a scheduled alert that will run on a specific date and time", "ContactLists":[668447], "VoiceCode":0, "FaxCode":0, "EmailCode":0, "SMSCode":660197, "PagerCode":0, "HotlinePhone":"", "HotlineSettings":null }'; $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