api-schema icon indicating copy to clipboard operation
api-schema copied to clipboard

Schedules: Listing does not include defined `overrides_subsection` and `final_schedule`

Open joshmfrankel opened this issue 2 years ago • 0 comments

In the api documentation for listing all Schedules, it shows the overrides_subschedule and final_schedule as returned response data. However, these don't seem accessible from this endpoint.

I was able to receive the rendered_schedule_entries from within schedule_layers by specifying:

  • include - ["schedule_layers"]
  • since - datetime string in past
  • until - datetime string in future
  • time_zone - string time zone

time_zone is required to utilize since or until. Since and until at this endpoint seem to be undocumented

Requesting a singular Schedule from the https://api.pagerduty.com /schedules/{id} endpoint will properly return overrides_subschedule and final_schedule. Ideally, this data would also be available from the Listing Schedules endpoint.

UPDATE You can indeed return available overrides from the /schedules/ endpoint. The following criteria is necessary to make it work:

  • include - ["schedule_layers", "overrides_subschedule"]
  • since - datetime string in past
  • until - datetime string in future
  • time_zone - string time zone

Basically, you must include overrides_subschedule within the include param of the API request. This along with a proper since and until where the override is within the time period, will properly return data.

joshmfrankel avatar Jan 25 '24 16:01 joshmfrankel