`, ``, ` `, ``, ` Nobody will be allowed admission to the Event without a valid ticket or pass. Tickets to this Event are issued on behalf of the Organiser and are subject to the following terms and conditions.`, etc.
- name: eventId | type: string | description: GUID of the event to which the policy belongs.
- name: metadata | type: PagingMetadataV2 | description: Metadata for the paginated results.
- name: count | type: integer | description: Number of items returned in the response.
- name: offset | type: integer | description: Offset that was requested.
- name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.
- name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.
- name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.
- name: next | type: string | description: Cursor pointing to next page in the list of results.
- name: prev | type: string | description: Cursor pointing to previous page in the list of results.
```
### Examples
### Query policies by event ID and sort by created date in descending order
```curl
curl -X POST 'https://www.wixapis.com/events/v2/policies/query' \
-H 'Content-Type: application/json' \
-H 'Authorization:
`"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }`.
**Example:**
`"filter" : { "id": "2224a9d1-79e6-4549-a5c5-bf7ce5aac1a5", "revision": {"$ne":"1"} }`
See [supported fields and operators](https://dev.wix.com/api/rest/wix-events/policy-v2/filter-and-sort) for more information.
- name: sort | type: array
`[{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]`
**Example:**
`[{"fieldName":"createdDate","direction":"DESC"}]`
See [supported fields](https://dev.wix.com/api/rest/wix-events/policy-v2/filter-and-sort) for more information.
- name: fieldName | type: string | description: Name of the field to sort by.
- name: order | type: SortOrder | description: Sort order (ASC/DESC). Defaults to ASC
- enum: ASC, DESC
Return type: PROMISE
Max: 40 characters
- name: body | type: string | description: Policy body. Usually contains various terms and conditions. Min: 1 character Max: 50,000 characters Note: You can format text using various HTML tags such as ``, etc.
- name: eventId | type: string | description: GUID of the event to which the policy belongs.
- name: metadata | type: PagingMetadataV2 | description: Metadata for the paginated results.
- name: count | type: integer | description: Number of items returned in the response.
- name: offset | type: integer | description: Offset that was requested.
- name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.
- name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.
- name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.
- name: next | type: string | description: Cursor pointing to next page in the list of results.
- name: prev | type: string | description: Cursor pointing to previous page in the list of results.
```
### Examples
### Query Policies by name and sort by _createdDate in descending order
```javascript
import { policies } from '@wix/events';
//query policies
async function queryPolicies() {
try {
const items = await policies.queryPolicies()
.eq('eventId', '3d3d5c04-ece0-45a8-85f0-11a58edaa192')
.ascending('_createdDate')
.find();
return items;
}
catch (error) {
console.error(error);
// Handle the error
}
};
/* Returns all found policies
{
"_items": [
{
"_id": "96b39980-e4e1-44e3-9ef0-9bec41d1cc10",
"revision": "6",
"_createdDate": "2023-03-08T13:55:18.057Z",
"_updatedDate": "2023-03-15T13:43:11.794Z",
"name": "Terms and Conditions Event 2",
"body": "