Setup
To use the Attendance API, install the @wix/bookings
package using npm or Yarn:
1npm install @wix/bookings
or
1yarn add @wix/bookings
Then import { attendance }
from @wix/bookings
:
1import { attendance } from '@wix/bookings'
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Sets information about whether a booking's session was attended for multiple bookings
See SetAttendance documentation for more information.
If any of the attendance list required fields were not passed on the request or if the caller doesn't have the required permissions to set the attendance, the call fails. If the request contains attendance info for unavailable sessions, the call completes successfully but the attendance info for the unavailable sessions are not created and are not considered as failures in the response.
Permission Scopes
For app development, you must have one of the following permission scopes:function bulkSetAttendance(attendanceList: Array<Attendance>, options: BulkSetAttendanceOptions): Promise<BulkSetAttendanceResponse>
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves attendance information by ID.
Permission Scopes
For app development, you must have one of the following permission scopes:function getAttendance(attendanceId: string): Promise<Attendance>
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
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.
PROPERTY | SUPPORTED FILTERS & SORTING |
---|---|
_id | eq() ,ne() ,in() ,ascending() |
bookingId | eq() ,ne() ,in() ,ascending() |
sessionId | eq() ,ne() ,in() ,ascending() |
status | eq() ,ne() ,in() ,ascending() |
numberOfAttendees | eq() ,ne() ,in() ,lt() ,le() ,gt() ,ge() ,ascending() ,descending() |
Permission Scopes
For app development, you must have one of the following permission scopes:function queryAttendance(): AttendancesQueryBuilder
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
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:function setAttendance(attendance: Attendance): Promise<SetAttendanceResponse>