Get scheduled events API

Retrieves information about the scheduled events in calendars.

Request

GET _ml/calendars/<calendar_id>/events

GET _ml/calendars/_all/events

Prerequisites

Description

You can get scheduled event information for a single calendar or for all calendars by using _all.

For more information, see Calendars and scheduled events.

Path parameters

<calendar_id>

(Required, string) A string that uniquely identifies a calendar.

Request body

end

(Optional, string) Specifies to get events with timestamps earlier than this time.

from

(Optional, integer) Skips the specified number of events.

size

(Optional, integer) Specifies the maximum number of events to obtain.

start

(Optional, string) Specifies to get events with timestamps after this time.

Response body

The API returns an array of scheduled event resources, which have the following properties:

calendar_id

(string) A string that uniquely identifies a calendar.

description

(string) A description of the scheduled event.

end_time

(date) The timestamp for the end of the scheduled event in milliseconds since the epoch or ISO 8601 format.

event_id

(string) An automatically-generated identifier for the scheduled event.

start_time

(date) The timestamp for the beginning of the scheduled event in milliseconds since the epoch or ISO 8601 format.

Examples

  1. GET _ml/calendars/planned-outages/events

The API returns the following results:

  1. {
  2. "count": 3,
  3. "events": [
  4. {
  5. "description": "event 1",
  6. "start_time": 1513641600000,
  7. "end_time": 1513728000000,
  8. "calendar_id": "planned-outages",
  9. "event_id": "LS8LJGEBMTCMA-qz49st"
  10. },
  11. {
  12. "description": "event 2",
  13. "start_time": 1513814400000,
  14. "end_time": 1513900800000,
  15. "calendar_id": "planned-outages",
  16. "event_id": "Li8LJGEBMTCMA-qz49st"
  17. },
  18. {
  19. "description": "event 3",
  20. "start_time": 1514160000000,
  21. "end_time": 1514246400000,
  22. "calendar_id": "planned-outages",
  23. "event_id": "Ly8LJGEBMTCMA-qz49st"
  24. }
  25. ]
  26. }