> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name: queryAttendance()

# Method package: wixBookingsV2

# Method menu location: wixBookingsV2 --> attendance --> queryAttendance

# Method Link: https://dev.wix.com/docs/velo/apis/wix-bookings-v2/attendance/query-attendance.md

# Method Description:

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 in `ASC` order
- `cursorPaging.limit` is `50`

For field support, see [supported filters](https://dev.wix.com/api/rest/wix-bookings/attendance/supported-filters).

> __Notes__:
> + Another way to retrieve attendance information is to call Bookings Reader V2's [Query Extended Bookings](https://dev.wix.com/api/rest/wix-bookings/bookings-reader-v2/query-extended-bookings) with `withBookingAttendanceDetails` as `true`.
> + 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](https://dev.wix.com/api/rest/getting-started/api-query-language).


|PROPERTY	|SUPPORTED FILTERS & SORTING	
|:---:|:---:|
|`_id`|[`eq()`](/attendance/attendances-query-builder/eq),[`ne()`](/attendance/attendances-query-builder/ne),[`in()`](/attendance/attendances-query-builder/in),[`ascending()`](/attendance/attendances-query-builder/ascending)|
|`bookingId`|[`eq()`](/attendance/attendances-query-builder/eq),[`ne()`](/attendance/attendances-query-builder/ne),[`in()`](/attendance/attendances-query-builder/in),[`ascending()`](/attendance/attendances-query-builder/ascending)|
|`sessionId`|[`eq()`](/attendance/attendances-query-builder/eq),[`ne()`](/attendance/attendances-query-builder/ne),[`in()`](/attendance/attendances-query-builder/in),[`ascending()`](/attendance/attendances-query-builder/ascending)|
|`status`|[`eq()`](/attendance/attendances-query-builder/eq),[`ne()`](/attendance/attendances-query-builder/ne),[`in()`](/attendance/attendances-query-builder/in),[`ascending()`](/attendance/attendances-query-builder/ascending)|
|`numberOfAttendees`|[`eq()`](/attendance/attendances-query-builder/eq),[`ne()`](/attendance/attendances-query-builder/ne),[`in()`](/attendance/attendances-query-builder/in),[`lt()`](/attendance/attendances-query-builder/lt),[`le()`](/attendance/attendances-query-builder/le),[`gt()`](/attendance/attendances-query-builder/gt),[`ge()`](/attendance/attendances-query-builder/ge),[`ascending()`](/attendance/attendances-query-builder/ascending),[`descending()`](/attendance/attendances-query-builder/descending)|



# Method Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## queryAttendance example

```javascript
import { attendance } from 'wix-bookings.v2';

async function queryAttendance() {
  const { items } = attendance.queryAttendance().find();
}

```

## queryAttendance example for exporting from backend code

```javascript
import { attendance } from 'wix-bookings.v2';
import { webMethod, Permissions } from 'wix-web-module';

export const queryAttendance = webMethod(
  Permissions.Anyone,
  async (query) => {
    try {
      const result = await attendance.queryAttendance(query);
      return result;
    } catch (error) {
      console.error(error);
      // Handle the error
    }
  }
);

```

---