Schedule Logs

Schedule logs keep the history of executed schedules. Each log is identified by id, and has these fields: output, created_at and schedule. This resource can only be read from the building block in order to consult the history of executions.

Scheme:

{
  "id": "UUID",
  "schedule_id": "String",
  "output": "String",
  "status": "String",
  "success": "Boolean",
  "created_at": "DateTime",
  "start_time": "DateTime",
  "duration": "Float"
}

Example:

{
  "id": "986c6f2e-7c49-4c0b-9bb3-9566ea3e9b02",
  "schedule_id": "bdc27b04-d358-11e6-bf26-cec0c932ce01",
  "output": "{\"some\": \"response\"}",
  "status": "200",
  "success": true,
  "created_at": "2017-01-05T15:06:51.762Z",
  "start_time": "2017-01-05T15:06:51.000Z",
  "duration": 2.0
}

GET methods

GET /api/v1/schedule_logs

Returns all schedule logs with their relative information if at least one resource exists, otherwise returns an empty collection. Request can contain a page parameter that returns a specific page, additionally total number of pages, next page, previous page and other information are described in the response header.

Example request:

GET /api/v1/schedule_logs HTTP/1.1
Host: https://scheduler.hid.facts4.work

Example response:

HTTP/1.1 200 OK
Content-type: application/json

[
  {
    "id": "986c6f2e-7c49-4c0b-9bb3-9566ea3e9b02",
    "schedule_id": "bdc27b04-d358-11e6-bf26-cec0c932ce01",
    "output": "{\"some\": \"response\"}",
    "status": "200",
    "success": true,
    "created_at": "2017-01-05T15:06:51.762Z",
    "start_time": "2017-01-05T15:06:51.000Z",
    "duration": 2.0
  }
]
Query Parameters:
 
  • access_token (string) – valid access token for OAuth2 authentication
Response JSON Array of Objects:
 
  • id (string) – id of the schedule log
  • schedule_id (string) – id of the schedule executed
  • output (string) – string output of the schedule executed
  • status (string) – status of execution (http code for WebRequest)
  • success (boolean) – schedule execution success
  • start_time (datetime) – UTC Datetime of start of execution
  • duration (float) – duration of the execution
Status Codes:
GET /api/v1/schedule_logs/:id

Returns a specific schedule log with :id and the rest of its parameters if it exists, otherwise returns 404 error.

Example request:

GET /api/v1/schedule_logs/986c6f2e-7c49-4c0b-9bb3-9566ea3e9b02 HTTP/1.1
Host: https://scheduler.hid.facts4.work

Example response:

HTTP/1.1 200 OK
Content-type: application/json

{
  "id": "986c6f2e-7c49-4c0b-9bb3-9566ea3e9b02",
  "schedule_id": "bdc27b04-d358-11e6-bf26-cec0c932ce01",
  "output": "{\"some\": \"response\"}",
  "status": "200",
  "success": true,
  "created_at": "2017-01-05T15:06:51.762Z",
  "start_time": "2017-01-05T15:06:51.000Z",
  "duration": 2.0
}
Parameters:
  • id (string) – schedule log’s unique id
Query Parameters:
 
  • access_token (string) – valid access token for OAuth2 authentication
Response JSON Object:
 
  • id (string) – id of the schedule log
  • schedule_id (string) – id of the schedule executed
  • output (string) – string output of the schedule executed
  • status (string) – status of execution (http code for WebRequest)
  • success (boolean) – schedule execution success
  • start_time (datetime) – UTC Datetime of start of execution
  • duration (float) – duration of the execution
Status Codes: