Skip to content

Commit 19ca807

Browse files
authored
Merge pull request #296 from BookingSync/CORE-793-add-hosts-endpoint-docs
Add hosts endpoint docs
2 parents 8d39735 + 992f38a commit 19ca807

File tree

6 files changed

+161
-0
lines changed

6 files changed

+161
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"hosts": [
3+
{
4+
"firstname": "Jan",
5+
"lastname": "Kowalski",
6+
"email": "[email protected]",
7+
"user_id": 2
8+
}
9+
]
10+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"links": {
3+
"hosts.user": "https://www.bookingsync.com/api/v3/users/{hosts.user}",
4+
"hosts.source": "https://www.bookingsync.com/api/v3/sources/{hosts.source}",
5+
"hosts.account": "https://www.bookingsync.com/api/v3/accounts/{hosts.account}",
6+
"hosts.participants": "https://www.bookingsync.com/api/v3/inbox/participants/{hosts.participants}"
7+
},
8+
"hosts": [
9+
{
10+
"links": {
11+
"account": 1,
12+
"participants": [],
13+
"source": null,
14+
"user": null
15+
},
16+
"id": 2,
17+
"firstname": "Jan",
18+
"lastname": "Kowalski",
19+
"email": "[email protected]",
20+
"created_at": "2018-12-26T19:51:24Z",
21+
"updated_at": "2018-12-26T19:51:24Z",
22+
"forget_me_at": null,
23+
"processing_restricted_at": null
24+
}
25+
],
26+
"meta": {
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"links": {
3+
"hosts.user": "http://test.host/api/v3/users/{hosts.user}",
4+
"hosts.source": "http://test.host/api/v3/sources/{hosts.source}",
5+
"hosts.account": "http://test.host/api/v3/accounts/{hosts.account}",
6+
"hosts.participants": "http://test.host/api/v3/inbox/participants/{hosts.participants}"
7+
},
8+
"hosts": [
9+
{
10+
"links": {
11+
"account": 1,
12+
"participants": [],
13+
"source": null,
14+
"user": 2
15+
},
16+
"id": 2,
17+
"firstname": "Jan",
18+
"lastname": "Kowalski",
19+
"email": "[email protected]",
20+
"created_at": "2018-12-26T20:03:54Z",
21+
"updated_at": "2018-12-26T20:03:54Z",
22+
"forget_me_at": null,
23+
"processing_restricted_at": null
24+
}
25+
],
26+
"meta": {
27+
}
28+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"hosts": [
3+
{
4+
"firstname": "Jan",
5+
"lastname": "Kowalski",
6+
"email": "[email protected]",
7+
"user_id": 2
8+
}
9+
]
10+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Hosts
2+
3+
1. TOC
4+
{:toc}
5+
6+
### Parameters
7+
<ul class="nav nav-pills" role="tablist">
8+
<li class="disabled"><a>OAuth Scopes:</a></li>
9+
<li class="active"><a href="#inbox_read" role="tab" data-toggle="pill">inbox_read</a></li>
10+
<li><a href="#inbox_write" role="tab" data-toggle="pill">inbox_write</a></li>
11+
</ul>
12+
<div class="tab-content" markdown="1">
13+
<div class="tab-pane active" id="inbox_read" markdown="1">
14+
Name | Type | Read/Write | Description
15+
-------------------------|---------|------------|------------
16+
id | Integer | Read | Host's id.
17+
-------------------------|---------|------------|------------
18+
firstname | String | Read | Host's first name.
19+
lastname | String | Read | Host's last name.
20+
email | String | Read | Host's email.
21+
-------------------------|---------|------------|------------
22+
created_at | [Time](/reference/enums#formats) | Read | Host's create time.
23+
updated_at | [Time](/reference/enums#formats) | Read | Host's update time.
24+
forget_me_at | [Time](/reference/enums#formats) | Read | Host's forget time.
25+
processing_restricted_at | [Time](/reference/enums#formats) | Read | Host's processing restriction time.
26+
{: class="table table-bordered"}
27+
</div>
28+
<div class="tab-pane" id="inbox_write" markdown="1">
29+
Name | Type | Read/Write | Description
30+
-------------------------|---------|------------|------------
31+
id | Integer | Read | Host's id.
32+
user_id | Integer | Read/Write | Host's user id.
33+
source_id | Integer | Read/Write | Host's source id.
34+
-------------------------|---------|------------|------------
35+
firstname | String | Read/Write | Host's first name.
36+
lastname | String | Read/Write | Host's last name.
37+
email | String | Read/Write | Host's email.
38+
-------------------------|---------|------------|------------
39+
created_at | [Time](/reference/enums#formats) | Read | Host's create time.
40+
updated_at | [Time](/reference/enums#formats) | Read | Host's update time.
41+
forget_me_at | [Time](/reference/enums#formats) | Read | Host's forget time.
42+
processing_restricted_at | [Time](/reference/enums#formats) | Read | Host's processing restriction time.
43+
{: class="table table-bordered"}
44+
</div>
45+
</div>
46+
47+
## List Hosts
48+
49+
~~~
50+
GET /hosts
51+
~~~
52+
53+
<%= render 'json_response', endpoint: "hosts", scopes: %w(inbox_read-inbox_write) %>
54+
55+
## Get a single Host
56+
57+
Returns a single host identified by ID.
58+
59+
~~~
60+
GET /hosts/:host_id
61+
~~~
62+
63+
<%= render 'json_response', endpoint: "hosts", scopes: %w(inbox_read-inbox_write) %>
64+
65+
## Create a new Host
66+
67+
Creates an host.
68+
69+
~~~~
70+
POST /hosts
71+
~~~~
72+
73+
<%= render 'json_response', endpoint: "hosts", request: "create", scopes: %w(inbox_write) %>
74+
75+
## Update a Host
76+
77+
Returns an updated host identified by ID.
78+
79+
~~~
80+
PUT /hosts/:host_id
81+
~~~
82+
83+
<%= render 'json_response', endpoint: "hosts", request: "update", scopes: %w(inbox_write) %>

layouts/reference.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ <h3 class="panel-title">Endpoints</h3>
6060
class: "list-group-item") %>
6161
<%= link_to_with_current("Fees Taxes", "/reference/endpoints/fees_taxes/",
6262
class: "list-group-item") %>
63+
<%= link_to_with_current("Hosts", "/reference/endpoints/hosts/",
64+
class: "list-group-item") %>
6365
<%= link_to_with_current("Inquiries", "/reference/endpoints/inquiries/",
6466
class: "list-group-item") %>
6567
<%= link_to_with_current("Living Rooms", "/reference/endpoints/living_rooms/",

0 commit comments

Comments
 (0)