<!-- Intent: updates the existing scheduled alert with schedulecode of 597737 --> <?php $url = 'http://api.v4.swiftreach.com/api/Alerts/Schedules/Update'; $authToken = '123456'; $jsonString = ' { "$type":"API.V4.DataWrappers.Schedule_Run_Once, API.V4", "IsActive":false, "ScheduleCode":597947, "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_CUSTOMREQUEST => "PUT", 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 --> 0