Skip to content

Commit 2d3b7c4

Browse files
committed
📚 add documentation for websites API Endpoints
1 parent 26c2d0b commit 2d3b7c4

File tree

3 files changed

+845
-1
lines changed

3 files changed

+845
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pids
1010
*.pid
1111
*.seed
1212
*.pid.lock
13+
.idea
1314

1415
# Directory for instrumented libs generated by jscoverage/JSCover
1516
lib-cov

README.md

Lines changed: 132 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,133 @@
11
# websites-docs
2-
documentation for pms websites api
2+
3+
> documentation for pms websites api
4+
5+
## Api Url
6+
all api endpoints are following the api url: `/api/v2`
7+
8+
### Api Token
9+
you will find the website Token on the `window` global in `window.Token` property.
10+
11+
all request should add `Authorization` header as the following:
12+
13+
```
14+
Authoriztion: Bearer (website Token string)
15+
```
16+
17+
## Api End-Points
18+
19+
### `GET` /websites
20+
> information about website configurtion, sections and section types
21+
the request returns the following json:
22+
23+
```json
24+
{
25+
"title": "BnbManager",
26+
"pic": "https://cdn.filepicker.io/api/file/AlWFuVc2SJ2WZnifpgp5",
27+
"logo": "https://cdn.filepicker.io/api/file/QYlJ9dOS7Kj4sSsTGwrj",
28+
"defaultStatusForNewReservations": "inquiry",
29+
"maxGuests": 4,
30+
"defaultSort": "title",
31+
"includedListings": [
32+
"568268ad8c44560e008e15fb"
33+
],
34+
"excludedListings": [],
35+
"sections": [
36+
{
37+
"name": "About",
38+
"type": "INFO"
39+
},
40+
{
41+
"name": "Services",
42+
"type": "SERVICES"
43+
},
44+
{
45+
"name": "Contact",
46+
"type": "CONTACT"
47+
}
48+
]
49+
}
50+
```
51+
52+
### `GET` /websites/:section
53+
54+
> section data by section type ie: INFO, SERVICES, CONTACT.
55+
a request to retrieve the info section `/websites/info` returns the following json:
56+
57+
```json
58+
{
59+
"_id": "592acbbbd491e69c0539da59",
60+
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. A amet aspernatur culpa ea eum explicabo fuga hic id in itaque minus nesciunt praesentium, quaerat, quisquam sapiente sequi tempore voluptate? Similique.",
61+
"title": "About Us"
62+
}
63+
```
64+
65+
### `GET` /listings
66+
> retrieve all active and listed listings
67+
you should pass the following QueryString Params:
68+
69+
| Param | Value |
70+
| ------------- | ------------- |
71+
| active | true |
72+
| listed | true |
73+
| fields | _id terms accommodates title beds propertyType address.city address.country address.state address.street publicDescription picture.regular picture.large |
74+
75+
`GET` /listings/:id
76+
> retrieve a listing by id
77+
you should pass the following QueryString params:
78+
79+
| Param | Value |
80+
| ------------- | ------------- |
81+
| fields | terms publicDescription prices amenities pictures address.street address.state address.country address.city beds bedrooms title timezone defaultCheckOutTime defaultCheckInTime _id bathrooms accommodates roomType propertyType beds bedrooms |
82+
83+
`GET` /listings/cities
84+
> get available cities for listings (city picker). request returns following json:
85+
86+
```json
87+
[
88+
"Amsterdam",
89+
"Londen",
90+
"London",
91+
"Willemstad",
92+
"Laag Zuthem",
93+
"Bussum",
94+
"New York",
95+
"Cusco",
96+
"Rotterdam",
97+
"Haarlem",
98+
"Amsterdam-Zuidoost",
99+
"Utrecht",
100+
"The Hague",
101+
"1054 Amsterdam",
102+
"San Francisco",
103+
"Embry",
104+
"Newton"
105+
]
106+
```
107+
108+
### `POST` /contact
109+
110+
> sends an email from the contact form. should send the following payload:
111+
112+
```json
113+
{
114+
"name": "fullName",
115+
"email": "email",
116+
"subject": "subject",
117+
"message": "message"
118+
}
119+
```
120+
121+
### `POST` /reservations/create
122+
123+
> create reservation from booking form. should send the following payload:
124+
125+
```json
126+
{
127+
"name": "fullName",
128+
"email": "email",
129+
"subject": "subject",
130+
"message": "message",
131+
"credit-card": "creditCard"
132+
}
133+
```

0 commit comments

Comments
 (0)