@@ -6,10 +6,6 @@ _url: [`https://websuck1t.herokuapp.com`](https://websuck1t.herokuapp.com)_
7## GET /posts/all
7## GET /posts/all
9−_start with: [`https://websuck1t.herokuapp.com/posts/all`](https://websuck1t.herokuapp.com/posts/all)_
11−Use this _url_ to get the token every time when application begins and previous session was closed
13### Response:
9### Response:
15- Status code 200
11- Status code 200
@@ -58,48 +54,12 @@ Use this _url_ to get the token every time when application begins and previous
62−- «token» to further use it in subscription to web socket
64−- «response» to start with the given number of posts in table
66−## WebSocket /posts/subscribe/:token
68−You access the web socket with the web socket protocol. I. e. `https://` -> `ws://`.
70−Open a web socket from the given `token` for receiving events about new and deleted posts with `ws://websuck1t.herokuapp.com/posts/subscribe/{token}`
72−#### Returns error `498` if the supplied token has expired or is invalid.
76−- *token*: The token, received with the previous request.
98−## GET /posts/:id
58+## GET /users/:id
100−_url: [`https://websuck1t.herokuapp.com/posts/{id}`](https://websuck1t.herokuapp.com/posts/1)_
60+Retrieves a user with the given `id`.
102−#### If there is no post with the given `id`, the method returns error `404`.
62+#### If there is no user with the given `id`, the method returns error `404`.
104### Captures:
64### Captures:
@@ -118,9 +78,11 @@ _url: [`https://websuck1t.herokuapp.com/posts/{id}`](https://websuck1t.herokuapp
119```javascript
79```javascript
121− «postBody»: «This is the post body»,
81+ "userName": {
122− «postAuthor»: 4,
82+ "secondName": "Leonidovich",
123− «postId»: 1
83+ "firstName": "Seva"
@@ -128,9 +90,11 @@ _url: [`https://websuck1t.herokuapp.com/posts/{id}`](https://websuck1t.herokuapp
129```javascript
91```javascript
131− «postBody»: «This is another post body»,
93+ "userName": {
132− «postAuthor»: 4,
94+ "secondName": "Barovich",
133− «postId»: 1
95+ "firstName": "Foo"
@@ -138,9 +102,11 @@ _url: [`https://websuck1t.herokuapp.com/posts/{id}`](https://websuck1t.herokuapp
139```javascript
103```javascript
141− «postBody»: «This is the post body»,
105+ "userName": {
142− «postAuthor»: 7,
106+ "secondName": "Fooovich",
143− «postId»: 1
107+ "firstName": "Bar"
@@ -148,30 +114,50 @@ _url: [`https://websuck1t.herokuapp.com/posts/{id}`](https://websuck1t.herokuapp
149```javascript
115```javascript
151− «postBody»: «This is another post body»,
117+ "userName": {
152− «postAuthor»: 7,
118+ "secondName": "Quixovich",
153− «postId»: 1
119+ "firstName": "Qux"
157−- Example (`application/json`):
125+## WebSocket /posts/subscribe/:token
127+You access the web socket with the web socket protocol. I. e. `https://` -> `ws://`.
129+Open a web socket from the given `token` for receiving events about new and deleted posts.
131+#### Returns error `498` if the supplied token has expired or is invalid.
136+- *token*: The token, received with the previous request.
159```javascript
140```javascript
161− «postBody»: «This is the post body»,
142+ "token": 1828,
162− «postAuthor»: 92,
143+ "response": {
163− «postId»: 1
144+ "deleted": [
170−_url: [`https://websuck1t.herokuapp.com/users/{id}`](https://websuck1t.herokuapp.com/users/1)_
172−Retrieves a user with the given `id`.
174−#### If there is no user with the given `id`, the method returns error `404`.
160+#### If there is no post with the given `id`, the method returns error `404`.
176### Captures:
162### Captures:
@@ -190,11 +176,9 @@ Retrieves a user with the given `id`.
191```javascript
177```javascript
193− "userName": {
179+ "postBody": "This is the post body",
194− "secondName": "Leonidovich",
180+ "postAuthor": 4,
195− "firstName": "Seva"
181+ "postId": 1
@@ -202,11 +186,9 @@ Retrieves a user with the given `id`.
203```javascript
187```javascript
205− "userName": {
189+ "postBody": "This is another post body",
206− "secondName": "Barovich",
190+ "postAuthor": 4,
207− "firstName": "Foo"
191+ "postId": 1
@@ -214,11 +196,9 @@ Retrieves a user with the given `id`.
215```javascript
197```javascript
217− "userName": {
199+ "postBody": "This is the post body",
218− "secondName": "Fooovich",
200+ "postAuthor": 7,
219− "firstName": "Bar"
201+ "postId": 1
@@ -226,10 +206,18 @@ Retrieves a user with the given `id`.
227```javascript
207```javascript
229− "userName": {
209+ "postBody": "This is another post body",
230− "secondName": "Quixovich",
210+ "postAuthor": 7,
231− "firstName": "Qux"
211+ "postId": 1
215+- Example (`application/json`):
219+ "postBody": "This is the post body",