The BookingsQueryBuilder
functions enable you to run, sort, filter, and control
which results a query returns.
Typically, you build a query using the Bookings query function,
refine the query by chaining BookingsQueryBuilder
functions, and then execute the
query by chaining the find()
function.
Note: Only users with Bookings Admin permissions can retrieve other customers' bookings. You can override the permissions by setting the suppressAuth
options to true
in the find()
function..
For example, the following code queries all bookings of the customer with the specified contact ID, and logs the first 5 results to the console, sorted in ascending order by the sessions' start times: