Scheduler APIs
-
List Scheduled Alerts
Description: Gets a list of scheduled alertsUsage:
GET api/Alerts/Schedules/List
Returns:
Array of ScheduledAlert objects
Examples:
<!-- Intent: get list of all the scheduled alert profiles GET to the following url http://api.v4.swiftreach.com/api/Alerts/Schedules/List --> <!-- No XML input is required --> <!-- example return value --> <ArrayOfScheduledAlert xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/API.V4.DataWrappers"> <ScheduledAlert i:type="Schedule_Run_Once"> <ChangeStamp>2013-04-02T10:40:55.4</ChangeStamp> <ChangedByUser></ChangedByUser> <ContactLists xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><d3p1:int>668447</d3p1:int></ContactLists> <CreateStamp>2013-04-02T10:40:55.4</CreateStamp> <CreatedByUser>sample</CreatedByUser> <Description></Description> <EmailCode>0</EmailCode> <FaxCode>0</FaxCode> <HotlinePhone></HotlinePhone> <HotlineSettings xmlns:d3p1="http://schemas.datacontract.org/2004/07/SwiftReach.Swift911.Core.Hotline" i:nil="true" /> <IsActive>true</IsActive> <LastRunDate>0001-01-01T00:00:00</LastRunDate> <PagerCode>0</PagerCode> <SMSCode>660197</SMSCode> <ScheduleCode>597737</ScheduleCode> <ScheduleType>run_once</ScheduleType> <TaskDateTime>4/2/2015 12:00 PM</TaskDateTime> <TaskName>Example Scheduled Alert</TaskName> <VoiceCode>0</VoiceCode> </ScheduledAlert> </ArrayOfScheduledAlert>"
-
Create New Scheduled Alert
Description: Creates a new scheduled alertUsage:
POST api/Alerts/Schedules/Create
Parameter Type Source Description AlertProfile ScheduledAlert FromBody ScheduledAlert object to add to the schedule Returns:
Unique numerical code identifying the new scheduled alert. 0 or less if there is an error.
Examples:
<!-- Intent: creates a new scheduled alert to send sms 660197 to contact list 668447 POST to the following url http://api.v4.swiftreach.com/api/Alerts/Schedules/Create --> <!-- XML Input --> <ScheduledAlert xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema/API.V4.DataWrappers" xsi:type="Schedule_Run_Once"> <IsActive>true</IsActive> <ScheduleType>run_once</ScheduleType> <TaskDateTime>4/2/2015 12:00 PM</TaskDateTime> <TaskName>My Scheduled Alert</TaskName> <Description>Example of a scheduled alert that will run on a specific date and time</Description> <ContactLists> <int>668447</int> </ContactLists> <VoiceCode>0</VoiceCode> <FaxCode>0</FaxCode> <EmailCode>0</EmailCode> <SMSCode>660197</SMSCode> <PagerCode>0</PagerCode> <HotlinePhone/> <HotlineSettings xsi:nil="true" /> </ScheduledAlert> <!-- example return value --> <int>597737</int>
-
Update Scheduled Alert
Description: Updates an existing alert scheduleUsage:
PUT api/Alerts/Schedules/Update
Parameter Type Source Description AlertProfile ScheduledAlert FromBody ScheduledAlert object to update Returns:
0 on success
Examples:
<!-- Intent: updates the existing scheduled alert with schedulecode of 597737 PUT to the following url http://api.v4.swiftreach.com/api/Alerts/Schedules/Update --> <!-- XML Input --> <ScheduledAlert xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema/API.V4.DataWrappers" xsi:type="Schedule_Run_Once"> <ScheduleCode>597737</ScheduleCode> <IsActive>true</IsActive> <ScheduleType>run_once</ScheduleType> <TaskDateTime>4/2/2015 12:00 PM</TaskDateTime> <TaskName>My Scheduled Alert 2</TaskName> <Description>Example of a scheduled alert that will run on a specific date and time</Description> <ContactLists> <int>668447</int> </ContactLists> <VoiceCode>0</VoiceCode> <FaxCode>0</FaxCode> <EmailCode>0</EmailCode> <SMSCode>660197</SMSCode> <PagerCode>0</PagerCode> <HotlinePhone/> <HotlineSettings xsi:nil="true" /> </ScheduledAlert> <!-- example return value --> <int>0</int>
-
Activate or Deactivate Schedule
Description: Activate or deactivate scheduled alertUsage:
PUT api/Alerts/Schedules/Toggle/{ScheduleCode}/{Enabled}
Parameter Type Source Description ScheduleCode Int32 FromUri Unique numerical code identifying the scheduled alert Enabled Boolean FromUri True if the scheduled alert should be enabled Returns:
0 on success
Examples:
<!-- Intent: Deactivates scheduled alert with schedulecode of 597737 PUT to the following url http://api.v4.swiftreach.com/api/Alerts/Schedules/Toggle/597737/false --> <!-- No XML input is required --> <!-- example return value --> <int>0</int>
-
Delete Scheduled Alert
Description: Delete a scheduled alertUsage:
DELETE api/Alerts/Schedules/Delete/{ScheduleCode}
Parameter Type Source Description ScheduleCode Int32 FromUri Unique numerical code identifying the scheduled alert Returns:
0 on success
Examples:
<!-- Intent: Delete scheduled alert with schedulecode of 100000 DELETE to the following url http://api.v4.swiftreach.com/api/Alerts/Schedules/Delete/100000 --> <!-- No XML input is required --> <!-- example return value --> <int>0</int>
-
Get Scheduled Alert Profile
Description: Gets the scheduled alert profile for the given schedulecodeUsage:
GET api/Alerts/Schedules/{ScheduleCode}
Parameter Type Source Description ScheduleCode Int32 FromUri Unique numerical code identifying the scheduled item Returns:
ScheduledAlert object
Examples:
<!-- Intent: get the scheduled alert profile for schedulecode 597737 GET to the following url http://api.v4.swiftreach.com/api/Alerts/Schedules/597737 --> <!-- No XML input is required --> <!-- example return value --> <ScheduledAlert xmlns:i="http://www.w3.org/2001/XMLSchema-instance" i:type="Schedule_Run_Once" xmlns="http://schemas.datacontract.org/2004/07/API.V4.DataWrappers"> <ChangeStamp>2013-04-02T10:40:55.4</ChangeStamp> <ChangedByUser></ChangedByUser> <ContactLists xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><d2p1:int>668447</d2p1:int></ContactLists> <CreateStamp>2013-04-02T10:40:55.4</CreateStamp> <CreatedByUser>sample</CreatedByUser> <Description></Description> <EmailCode>0</EmailCode> <FaxCode>0</FaxCode> <HotlinePhone></HotlinePhone> <HotlineSettings xmlns:d2p1="http://schemas.datacontract.org/2004/07/SwiftReach.Swift911.Core.Hotline" i:nil="true" /> <IsActive>true</IsActive> <LastRunDate>0001-01-01T00:00:00</LastRunDate> <PagerCode>0</PagerCode> <SMSCode>660197</SMSCode> <ScheduleCode>597737</ScheduleCode> <ScheduleType>run_once</ScheduleType> <TaskDateTime>4/2/2015 12:00 PM</TaskDateTime> <TaskName>Example Scheduled Alert</TaskName> <VoiceCode>0</VoiceCode> </ScheduledAlert>