Search.../
  1. REST
Generate a test token to explore our APIs

Query Resources

Developer Preview

Retrieves a list of the resources according to the specified filters and paging.

The query parameter is optional. If no query is provided than all non-deleted resources are returned.

PropertyIs supported
filtersupported fields: resource.id, resource.tags, resource.status
pagingsupported
fieldssupported
fieldsetsnot supported
sortnot supported

Notes:

  • The following objects in the query parameter are not supported for this query:
    • sort
    • fieldsets

Permissions
This endpoint requires the Read Bookings Calendar, Read Bookings - Public Data, Read Bookings - Including Participants or Manage Bookings permission scope.

Syntax

function QueryResources(query: _wix_common_QueryV2): Query<_com_wixpress_bookings_resources_core_api_v1_resource_QueryResourcesResponse>

Query Resources Parameters

NAME
TYPE
DESCRIPTION
query
object

Returns

Return Type:

object
NAME
TYPE
DESCRIPTION
resources
Array<object>

List of resources matching the query object.

pagingMetadata
object

Was this helpful?

Query Resource

Return a list of resources with a "staff" tag and a status of "UPDATED" or "DELETED".

Request

curl

Copy Code
1curl -L -X POST 'https://www.wixapis.com/bookings/v1/resources/query' \
2-H 'Authorization: <AUTH>' \
3-H 'Content-Type: application/json' \
4--data-raw '{
5 "query": {
6 "filter":{"resource.tags":{"$in":"staff"},
7 "resource.status":{"$in":["DELETED","UPDATED"]}
8 },
9 "fields":["name","tags", "status"],
10 "paging" :{"limit" : 10, "offset" : 3}
11 }
12}'

Response

json

1{
2 "resources": [
3 {
4 "name": "John Doe",
5 "tags": ["staff"],
6 "images": [],
7 "schedules": [],
8 "scheduleIds": [],
9 "status": "DELETED"
10 },
11 {
12 "name": "Frank Walker",
13 "tags": ["staff"],
14 "images": [],
15 "schedules": [],
16 "scheduleIds": [],
17 "status": "DELETED"
18 },
19 {
20 "name": "Francine Williams",
21 "tags": ["staff"],
22 "images": [],
23 "schedules": [],
24 "scheduleIds": [],
25 "status": "DELETED"
26 },
27 {
28 "name": "Jack Black",
29 "tags": ["staff"],
30 "images": [],
31 "schedules": [],
32 "scheduleIds": [],
33 "status": "UPDATED"
34 },
35 {
36 "name": "Bonita Juan",
37 "tags": ["staff"],
38 "images": [],
39 "schedules": [],
40 "scheduleIds": [],
41 "status": "DELETED"
42 },
43 {
44 "name": "Sven Jorgensen",
45 "tags": ["staff"],
46 "images": [],
47 "schedules": [],
48 "scheduleIds": [],
49 "status": "DELETED"
50 },
51 {
52 "name": "Michael McDonald",
53 "tags": ["staff"],
54 "images": [],
55 "schedules": [],
56 "scheduleIds": [],
57 "status": "DELETED"
58 },
59 {
60 "name": "Lisa Lopez",
61 "tags": ["staff"],
62 "images": [],
63 "schedules": [],
64 "scheduleIds": [],
65 "status": "DELETED"
66 },
67 {
68 "name": "Sofia Carlton",
69 "tags": ["staff"],
70 "images": [],
71 "schedules": [],
72 "scheduleIds": [],
73 "status": "DELETED"
74 },
75 {
76 "name": "Paul St. John",
77 "tags": ["staff"],
78 "images": [],
79 "schedules": [],
80 "scheduleIds": [],
81 "status": "DELETED"
82 }
83 ],
84 "pagingMetadata": {
85 "count": 10,
86 "offset": 3,
87 "total": 178
88 }
89}