Triggering a Schedule

A schedule can be triggered to execute using the REST API.

In the following example, we’ll use the REST API to first find, then trigger and finally poll to get the results from a schedule. This is somewhat technical, and in order to follow along you will need some experience with http, json and command-line environments.

In this example, we’ll use a controller installed on the local computer (localhost) on port 9000 and assume that a schedule called “test” has already been created.

Note: The REST API can be explored using real-time calls by going to this url in a browser: http://localhost:9000/help/index

Step 1: Open a command-line environment such as PowerShell in Windows, Terminal in OSX or eg. bash in Linux.

Step 2: On the command line, make an http request to the controller to get all schedules on the Controller.

Using curl:

Using PowerShell:

If you have performed the http request correctly, the response code will be 200 (OK) and the response body will be a json string that looks something like this:

Step 3: Identify the “Id” of the schedule.

The json contains a lot of information about the schedule, including the full history of previous runs. However, for this example all we need is the “Id”, which in this example is “985d358a-358c-477e-bbb6-884cf02ca159”.

Step 4: Make an http request to run the schedule now.

Using curl:

Using Powershell:

The response code should be 204 (No Content) and if you open Studio and look under “Scheduling”, the schedule should already be queued for execution.

Updated February 19th 2018.