eventsHandler(_:)

func eventsHandler(_ req: Request) async throws -> [EventData]

GET /api/v3/events

Retrieve a list of scheduled events. By default, this retrieves the entire event schedule.

URL Query Parameters:

  • cruiseday=INT Embarkation day is day 1, value should be less than or equal to Settings.shared.cruiseLengthInDays, which will be 8 for the 2022 cruise.
  • day=STRING 3 letter day of week abbreviation e.g. “TUE” .Returns events for that day of the cruise in 2022 “SAT” returns events for embarkation day while the current date is earlier than embarkation day, then it returns events for disembarkation day.
  • ?date=DATE Returns events occurring on the given day. Empty list if there are no cruise events on that day.
  • ?time=DATE Returns events whose startTime is earlier (or equal) to DATE and endTime is later than DATE. Note that this will often include ‘all day’ events.
  • ?type=[official, shadow] Only returns events matching the selected type.
  • ?search=STRING Returns events whose title or description contain the given string.

The ?day=STRING query parameter is intended to make it easy to get schedule events returned even when the cruise is not occurring, for ease of testing. The day and date parameters actually return events from 3AM local time on the given day until 3AM the next day–some events start after midnight and tend to get lost by those looking at daily schedules.

All the above parameters filter the set of EventData objects that get returned. Onlly one of [cruiseday, day, date, time] may be used.

Return Value

An array of EventData containing filtered events.