With the Wix Bookings Attendance API, you can retrieve and manage a booked session's attendance information by:
- Setting the attendance for a given booked session.
- Getting the attendance information for a given booked session by ID.
- Querying the attendance by given filters, sorting, and paging.
The attendance object holds information about the attendance of a booked session, such as:
- Did anyone attend the session?
- How many people attended the session?
The number of session Attendance
objects available depends on session types:
- Appointment sessions have 1
Attendance
object per appointment. - Class sessions have an
Attendance
object for each session of the class. The number of sessions for a class is defined in Schedule and Sessions'schedule.capacity
property. - Course sessions have an
Attendance
object for each session of the course. The number of sessions for a class is defined in Schedule and Sessions'schedule.capacity
property.
Common business usages for this API include:
- Set the attendance for a given booked session to reflect how many attendees checked in.
- Query the attendance for a given participant in a course booking.
- Query attendance for a particular booking's sessions over time to see if a particular session has frequent no-shows. You can compare the number of attendees to the number of participants that signed up for that booking's sessions.
For a comprehensive glossary of Wix Bookings terms, see Terminology.
Validation capabilities are limited. Make sure your code validates that:
- There is no mismatch between
numberOfAttendees
andattendanceStatus
to make sure, for example, thatattendanceStatus
is notNOT_ATTENDED
whilenumberOfAttendees
is5
. - The attendance's
numberOfAttendees
and the booking'snumberOfParticipants
correspond. For example, the number of attendees usually should not exceed the booking's intended number of participants (unless perhaps you allow walk-ins that did not sign up in advance).
Query Attendance runs with these defaults:
- sorted by
id
inASC
order - cursorPaging.limit is
50
The following table shows field support for filters for the Attendance
object:
Field | Supported Filters | Sortable |
---|---|---|
id | $eq , $ne , $in , $nin , $hasSome | Sortable |
bookingId | $eq , $ne , $in , $nin , $hasSome | Sortable |
sessionId | $eq , $ne , $in , $nin , $hasSome | Sortable |
status | $eq , $ne , $in , $nin , $hasSome | Sortable |
numberOfAttendees | $eq , $ne , $in , $nin , $hasSome , $lt , $lte , $gt , $gte | Sortable |
Notes:
- Only 1 filter is supported per query. If you define multiple filters in the same query, only the first is processed.
To learn about working with query endpoints, see API Query Language, Sorting and Paging, and Field Projection.
- NOT_SET: There is no available attendance information.
- ATTENDED: At least a single participant attended the session.
- NOT_ATTENDED: No participants attended the session.
Retrieves attendance information by ID.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Sets information about whether a booking's session was attended. This information
is saved in an Attendance
object.
If attendance was already set, meaning the Attendance
object already exists, the
existing attendance information is updated. Otherwise, a new Attendance
object
is created.
By default, the number
of attendees is set to 1
, but you can set a number to greater than 1
if multiple
participants attended. Do not set to 0
to indicate that no one attended the session.
Instead, set the status
field to NOT_ATTENDED
.
Note: Make sure your code validates that:
- There is no mismatch between
numberOfAttendees
andattendanceStatus
to make sure, for example, thatattendanceStatus
is notNOT_ATTENDED
whilenumberOfAttendees
is5
.- The attendance's
numberOfAttendees
and the booking'snumberOfParticipants
correspond. For example, the number of attendees usually should not exceed the booking's intended number of participants (unless perhaps you allow walk-ins that did not sign up in advance).
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Retrieves attendance information for booked sessions, given the provided paging, filtering, and sorting.
When querying attendance information, you can query from the perspective of:
- A booking. Specify a booking ID to retrieve attendance information for all sessions related to that booking.
- A session. Specify a session ID to retrieve attendance information for all bookings related to that session.
For example, query by a course's bookingId
and status = "NOT_ATTENDED"
to
retrieve the attendance of a given participant in a course. For example, this query
helps you determine if a participant booked the course
but did not attend most of its sessions, taking away spots for other potential participants.
Query Attendance runs with the following defaults, which you can override:
id
sorted inASC
ordercursorPaging.limit
is50
For field support, see supported filters.
Notes:
- Another way to retrieve attendance information is to call Bookings Reader V2's Query Extended Bookings with
withBookingAttendanceInfo
astrue
.- Up to 100 results can be returned per request.
- Only 1 filter is supported per query. If you define multiple filters in the same query, only the first is processed.
To learn about working with query endpoints, see API Query Language.