Skip to content

Latest commit

 

History

History
119 lines (86 loc) · 5.8 KB

File metadata and controls

119 lines (86 loc) · 5.8 KB
title Events
nav_order 5

Unlike appointments made through a normal service events starts and ends at a specific time. An event is connected to a resource and a service. It could be either a one-off event (e.g. a concert) or something that occurs multiple times (e.g. spinning class). Event bookings have a strong relation to the event. That means that it is not possible to modify details such as {booked_from}, {booked_to}, {resource_id} and {service_id} for the {booking}. To make such changes it must be done to the event. All bookings connected to the event will then automatically be modified.

While events are connected to a resource bookings or capacity of an event are not restricted by the opening hours or availability of a resource.

Attributes

NameTypeDescription
idIntegerAutomatically set
created_atDatetimeAutomatically set
updated_atDatetimeAutomatically set
resource_idIntegerRequired
service_idIntegerRequired
publishedBooleanDefault: true
capacityIntegerRequired
starts_atDatetimeRequired
ends_atDatetimeRequired
custom_dataArrayNot required
titleString
descriptionText
first_booking_atDatetimeNot required. Earliest allowed booking time.
last_booking_atDatetimeNot required. Latest allowed booking time.
availabilityIntegerOnly for output. Current available capacity.
nr_of_attendancesIntegerOnly for output. Number of current attendees.

Listing

GET /events will return all events.

Response

[
  {
    "event": {
      "capacity": 10,
      "created_at": "2012-09-20T15:34:16+02:00",
      "custom_data": null,
      "description": null,
      "ends_at": "2015-08-10T11:30:00+02:00",
      "id": 1,
      "resource_id": 1,
      "published": true,
      "starts_at": "2015-08-10T10:00:00+02:00",
      "service_id": 1,
      "title": "Super fun event",
      "updated_at": "2012-09-20T15:34:16+02:00"
    }
  }
]

Query Parameters

NameTypeDescription
service_idInteger
resource_idInteger
startDatetimestarts_at after param
endDatetimeends_at before param
sinceDatetimeupdated_at after param

Get event

GET /events/{event_id} will get an event with id {event_id}.

Add new event

POST /events will create a new event.

Add recurring/multiple events

POST /events/recurring will create multiple events.

The recurrence format follows the iCalendar specification{:target="_blank"}. The attributes for recurrence are: RRULE, RDATE, EXDATE. For an introduction and examples of these parameters see this section from the iCalendar specification{:target="_blank"}.

In the iCalendar specification the recurrence is based on values in DTSTART and DTEND. This is set by starts_at and ends_at from event.

All recurring events will except for starts_at and ends_at have the same attributes based on the specified parameters in event.

All events created by the recurring pattern gets the same UUID in collection_id. As the collection name implies, and as is possible with the iCalendar specification, this is not necessarily only for recurrence (i.e. 9am-10am each Friday until December 1st) but also for multiple specific times (as can be specified with RDATE).

Only the collection_id is returned. No events are created at the time of request as they will be processed by the server in the background due to the volume of events that it is possible to create at one time. A successful response with a collection_id does in no way indicate that any events will be created. The first event as defined in event is however validated. If it is not valid errors details are returned in the same way as creating a single event. In such a case recurring rules are not applied and you must adjust the request until validation is successful.

Parameters for recurrence

The parameters for recurrence are not set in event but in recurrence.

NameTypeDescription
rruleStringRepeating pattern. Example: `FREQ=DAILY;UNTIL=19971224T000000Z`.
rdateStringList of recurring dates. Example: `VALUE=DATE:19970101,19970120,19970217,19970421`.
exdateStringList of dates that should be excluded from the recurring rule. Example: `VALUE=DATE:19970102`.

You should always specify COUNT or UNTIL with RRULE. The max number of occurrences is 731, regardless if a limit is set or not.

List occurrences

GET /events/recurring/{collection_id} will return all occurrences for a collection.

Update event

PUT /events/{event_id} will update existing event with id {event_id}.

Delete event

DELETE /events/{event_id} will delete existing event with id {event_id}. Deleting an event will set it to active=false and will not be returned in any listings.

List bookings

GET /events/{event_id}/bookings will return all bookings for event with id {event_id}.