Search.../
  1. Home
  2. Getting Started
  3. Overview
Generate a test token to explore our APIs

Create Resource

Developer Preview

Creates a resource.

Authorization

This endpoint requires an authorization header - pass the access token from the OAuth installation flow.

Permissions

This endpoint requires the Manage Bookings permission scope.

POST

https://www.wixapis.com/bookings/v1/resources

Body Params

NAME
TYPE
DESCRIPTION
resource

object

Resource to create.

Response Object

NAME
TYPE
DESCRIPTION
resource

object

Created resource.

Status/Error Codes

The response will include an HTTP status code.

Was this helpful?

Create Resource

Creates a resource with its working hours.

Request

curl

Copy Code
1curl -X POST \
2 'https://www.wixapis.com/bookings/v1/resources' \
3 -H "Content-Type: application/json" \
4 -H 'Authorization: <AUTH>' \
5 --data '{
6 "resource": {
7 "name": "Arnold Stern",
8 "email": "arnold@mysite.info",
9 "phone": "620-428-1741",
10 "tags": [
11 "staff"
12 ],
13 "images": [],
14 "schedules": [
15 {
16 "firstSessionStart": "2020-04-19T06:00:00Z",
17 "timeZone": "Asia/Jerusalem",
18 "intervals": [
19 {
20 "start": "2020-04-18T21:00:00Z",
21 "interval": {
22 "daysOfWeek": "FRI",
23 "hourOfDay": 10,
24 "minuteOfHour": 0,
25 "duration": 480
26 },
27 "frequency": {
28 "repetition": 1
29 },
30 "affectedSchedules": []
31 },
32 {
33 "start": "2020-04-18T21:00:00Z",
34 "interval": {
35 "daysOfWeek": "SAT",
36 "hourOfDay": 9,
37 "minuteOfHour": 0,
38 "duration": 540
39 },
40 "frequency": {
41 "repetition": 1
42 },
43 "affectedSchedules": []
44 },
45 {
46 "start": "2020-04-18T21:00:00Z",
47 "interval": {
48 "daysOfWeek": "SUN",
49 "hourOfDay": 9,
50 "minuteOfHour": 0,
51 "duration": 540
52 },
53 "frequency": {
54 "repetition": 1
55 },
56 "affectedSchedules": []
57 }
58 ],
59 "tags": [],
60 "availability": {
61 "start": "2020-04-18T21:00:00Z",
62 "linkedSchedules": []
63 },
64 "totalNumberOfParticipants": 0,
65 "participants": [],
66 "inheritedFields": [
67 "timeZone"
68 ]
69 }
70 ]
71 }
72 }'

Response

json

1
2{"resource": {
3 "id": "7d0ab54b-d782-4f24-a7d8-b563fbb211bb",
4 "name": "Arnold Stern",
5 "email": "arnold@mysite.info",
6 "phone": "620-428-1741",
7 "tags": ["staff"],
8 "images": [],
9 "schedules": [ {
10 "id": "a1aa5a30-1482-4c23-86f0-efbb03cbc128",
11 "scheduleOwnerId": "7d0ab54b-d782-4f24-a7d8-b563fbb211bb",
12 "firstSessionStart": "2020-04-19T13:00:00Z",
13 "timeZone": "Asia/Jerusalem",
14 "intervals": [
15 {
16 "id": "9ebd9d11-b3d8-47ad-883b-89054982b6d2",
17 "start": "2020-04-18T21:00:00Z",
18 "interval": {
19 "daysOfWeek": "FRI",
20 "hourOfDay": 10,
21 "minuteOfHour": 0,
22 "duration": 480
23 },
24 "frequency": {"repetition": 1},
25 "affectedSchedules": []
26 },
27 {
28 "id": "5785bc19-5aff-4bbe-bab9-8d2d41f59a4e",
29 "start": "2020-04-18T21:00:00Z",
30 "interval": {
31 "daysOfWeek": "SAT",
32 "hourOfDay": 9,
33 "minuteOfHour": 0,
34 "duration": 540
35 },
36 "frequency": {"repetition": 1},
37 "affectedSchedules": []
38 },
39 {
40 "id": "45b5c705-331d-4318-8e24-a64e21508246",
41 "start": "2020-04-18T21:00:00Z",
42 "interval": {
43 "daysOfWeek": "SUN",
44 "hourOfDay": 9,
45 "minuteOfHour": 0,
46 "duration": 540
47 },
48 "frequency": {"repetition": 1},
49 "affectedSchedules": []
50 }
51 ],
52 "tags": [],
53 "availability": {
54 "start": "2020-04-18T21:00:00Z",
55 "linkedSchedules": []
56 },
57 "totalNumberOfParticipants": 0,
58 "participants": [],
59 "status": "CREATED",
60 "created": "2020-04-30T13:26:19.985Z",
61 "updated": "2020-04-30T13:26:19.985Z",
62 "version": 0,
63 "inheritedFields": []
64 }],
65 "status": "CREATED"
66}}