Line 0
Link Here
|
|
|
1 |
{ |
2 |
"/bookings": { |
3 |
"get": { |
4 |
"x-mojo-to": "Bookings#list", |
5 |
"operationId": "listBookings", |
6 |
"tags": [ |
7 |
"bookings" |
8 |
], |
9 |
"summary": "List bookings", |
10 |
"produces": [ |
11 |
"application/json" |
12 |
], |
13 |
"parameters": [ |
14 |
{ |
15 |
"name": "biblio_id", |
16 |
"in": "query", |
17 |
"description": "Case insensative search on booking biblio_id", |
18 |
"required": false, |
19 |
"type": "string" |
20 |
}, |
21 |
{ |
22 |
"name": "item_id", |
23 |
"in": "query", |
24 |
"description": "Case insensative search on booking item_id", |
25 |
"required": false, |
26 |
"type": "string" |
27 |
}, |
28 |
{ |
29 |
"name": "patron_id", |
30 |
"in": "query", |
31 |
"description": "Case insensative search on booking patron_id", |
32 |
"required": false, |
33 |
"type": "string" |
34 |
}, |
35 |
{ |
36 |
"name": "start_date", |
37 |
"in": "query", |
38 |
"description": "Case Insensative search on booking start_date", |
39 |
"required": false, |
40 |
"type": "string" |
41 |
}, |
42 |
{ |
43 |
"name": "end_date", |
44 |
"in": "query", |
45 |
"description": "Case Insensative search on booking end_date", |
46 |
"required": false, |
47 |
"type": "string" |
48 |
}, |
49 |
|
50 |
{ |
51 |
"$ref": "../parameters.json#/match" |
52 |
}, |
53 |
{ |
54 |
"$ref": "../parameters.json#/order_by" |
55 |
}, |
56 |
{ |
57 |
"$ref": "../parameters.json#/page" |
58 |
}, |
59 |
{ |
60 |
"$ref": "../parameters.json#/per_page" |
61 |
}, |
62 |
{ |
63 |
"$ref": "../parameters.json#/q_param" |
64 |
}, |
65 |
{ |
66 |
"$ref": "../parameters.json#/q_body" |
67 |
}, |
68 |
{ |
69 |
"$ref": "../parameters.json#/q_header" |
70 |
} |
71 |
], |
72 |
"responses": { |
73 |
"200": { |
74 |
"description": "A list of bookings", |
75 |
"schema": { |
76 |
"type": "array", |
77 |
"items": { |
78 |
"$ref": "../definitions.json#/booking" |
79 |
} |
80 |
} |
81 |
}, |
82 |
"403": { |
83 |
"description": "Access forbidden", |
84 |
"schema": { |
85 |
"$ref": "../definitions.json#/error" |
86 |
} |
87 |
}, |
88 |
"500": { |
89 |
"description": "Internal error", |
90 |
"schema": { |
91 |
"$ref": "../definitions.json#/error" |
92 |
} |
93 |
}, |
94 |
"503": { |
95 |
"description": "Under maintenance", |
96 |
"schema": { |
97 |
"$ref": "../definitions.json#/error" |
98 |
} |
99 |
} |
100 |
}, |
101 |
"x-koha-authorization": { |
102 |
"permissions": { |
103 |
"catalogue": "1" |
104 |
} |
105 |
} |
106 |
}, |
107 |
"post": { |
108 |
"x-mojo-to": "Bookings#add", |
109 |
"operationId": "addBooking", |
110 |
"tags": [ |
111 |
"bookings" |
112 |
], |
113 |
"summary": "Add booking", |
114 |
"parameters": [ |
115 |
{ |
116 |
"name": "body", |
117 |
"in": "body", |
118 |
"description": "A JSON object containing informations about the new booking", |
119 |
"required": true, |
120 |
"schema": { |
121 |
"$ref": "../definitions.json#/booking" |
122 |
} |
123 |
} |
124 |
], |
125 |
"produces": [ |
126 |
"application/json" |
127 |
], |
128 |
"responses": { |
129 |
"201": { |
130 |
"description": "Booking added", |
131 |
"schema": { |
132 |
"$ref": "../definitions.json#/booking" |
133 |
} |
134 |
}, |
135 |
"400": { |
136 |
"description": "Client error", |
137 |
"schema": { |
138 |
"$ref": "../definitions.json#/error" |
139 |
} |
140 |
}, |
141 |
"401": { |
142 |
"description": "Authentication required", |
143 |
"schema": { |
144 |
"$ref": "../definitions.json#/error" |
145 |
} |
146 |
}, |
147 |
"403": { |
148 |
"description": "Access forbidden", |
149 |
"schema": { |
150 |
"$ref": "../definitions.json#/error" |
151 |
} |
152 |
}, |
153 |
"500": { |
154 |
"description": "Internal error", |
155 |
"schema": { |
156 |
"$ref": "../definitions.json#/error" |
157 |
} |
158 |
}, |
159 |
"503": { |
160 |
"description": "Under maintenance", |
161 |
"schema": { |
162 |
"$ref": "../definitions.json#/error" |
163 |
} |
164 |
} |
165 |
}, |
166 |
"x-koha-authorization": { |
167 |
"permissions": { |
168 |
"parameters": "manage_bookings" |
169 |
} |
170 |
} |
171 |
} |
172 |
}, |
173 |
"/bookings/{booking_id}": { |
174 |
"get": { |
175 |
"x-mojo-to": "Bookings#get", |
176 |
"operationId": "getBooking", |
177 |
"tags": [ |
178 |
"bookings" |
179 |
], |
180 |
"summary": "Get booking", |
181 |
"parameters": [ |
182 |
{ |
183 |
"$ref": "../parameters.json#/booking_id_pp" |
184 |
} |
185 |
], |
186 |
"produces": [ |
187 |
"application/json" |
188 |
], |
189 |
"responses": { |
190 |
"200": { |
191 |
"description": "A booking", |
192 |
"schema": { |
193 |
"$ref": "../definitions.json#/booking" |
194 |
} |
195 |
}, |
196 |
"404": { |
197 |
"description": "Booking not found", |
198 |
"schema": { |
199 |
"$ref": "../definitions.json#/error" |
200 |
} |
201 |
}, |
202 |
"500": { |
203 |
"description": "Internal error", |
204 |
"schema": { |
205 |
"$ref": "../definitions.json#/error" |
206 |
} |
207 |
}, |
208 |
"503": { |
209 |
"description": "Under maintenance", |
210 |
"schema": { |
211 |
"$ref": "../definitions.json#/error" |
212 |
} |
213 |
} |
214 |
}, |
215 |
"x-koha-authorization": { |
216 |
"permissions": { |
217 |
"catalogue": "1" |
218 |
} |
219 |
} |
220 |
}, |
221 |
"put": { |
222 |
"x-mojo-to": "Bookings#update", |
223 |
"operationId": "updateBooking", |
224 |
"tags": [ |
225 |
"bookings" |
226 |
], |
227 |
"summary": "Update booking", |
228 |
"parameters": [ |
229 |
{ |
230 |
"$ref": "../parameters.json#/booking_id_pp" |
231 |
}, |
232 |
{ |
233 |
"name": "body", |
234 |
"in": "body", |
235 |
"description": "A booking object", |
236 |
"required": true, |
237 |
"schema": { |
238 |
"$ref": "../definitions.json#/booking" |
239 |
} |
240 |
} |
241 |
], |
242 |
"produces": [ |
243 |
"application/json" |
244 |
], |
245 |
"responses": { |
246 |
"200": { |
247 |
"description": "A booking", |
248 |
"schema": { |
249 |
"$ref": "../definitions.json#/booking" |
250 |
} |
251 |
}, |
252 |
"400": { |
253 |
"description": "Client error", |
254 |
"schema": { |
255 |
"$ref": "../definitions.json#/error" |
256 |
} |
257 |
}, |
258 |
"401": { |
259 |
"description": "Authentication required", |
260 |
"schema": { |
261 |
"$ref": "../definitions.json#/error" |
262 |
} |
263 |
}, |
264 |
"403": { |
265 |
"description": "Access forbidden", |
266 |
"schema": { |
267 |
"$ref": "../definitions.json#/error" |
268 |
} |
269 |
}, |
270 |
"404": { |
271 |
"description": "Booking not found", |
272 |
"schema": { |
273 |
"$ref": "../definitions.json#/error" |
274 |
} |
275 |
}, |
276 |
"500": { |
277 |
"description": "Internal error", |
278 |
"schema": { |
279 |
"$ref": "../definitions.json#/error" |
280 |
} |
281 |
}, |
282 |
"503": { |
283 |
"description": "Under maintenance", |
284 |
"schema": { |
285 |
"$ref": "../definitions.json#/error" |
286 |
} |
287 |
} |
288 |
}, |
289 |
"x-koha-authorization": { |
290 |
"permissions": { |
291 |
"parameters": "manage_bookings" |
292 |
} |
293 |
} |
294 |
}, |
295 |
"delete": { |
296 |
"x-mojo-to": "Bookings#delete", |
297 |
"operationId": "deleteBooking", |
298 |
"tags": [ |
299 |
"bookings" |
300 |
], |
301 |
"summary": "Delete booking", |
302 |
"parameters": [ |
303 |
{ |
304 |
"$ref": "../parameters.json#/booking_id_pp" |
305 |
} |
306 |
], |
307 |
"produces": [ |
308 |
"application/json" |
309 |
], |
310 |
"responses": { |
311 |
"204": { |
312 |
"description": "Booking deleted" |
313 |
}, |
314 |
"401": { |
315 |
"description": "Authentication required", |
316 |
"schema": { |
317 |
"$ref": "../definitions.json#/error" |
318 |
} |
319 |
}, |
320 |
"403": { |
321 |
"description": "Access forbidden", |
322 |
"schema": { |
323 |
"$ref": "../definitions.json#/error" |
324 |
} |
325 |
}, |
326 |
"404": { |
327 |
"description": "Booking not found", |
328 |
"schema": { |
329 |
"$ref": "../definitions.json#/error" |
330 |
} |
331 |
}, |
332 |
"500": { |
333 |
"description": "Internal error", |
334 |
"schema": { |
335 |
"$ref": "../definitions.json#/error" |
336 |
} |
337 |
}, |
338 |
"503": { |
339 |
"description": "Under maintenance", |
340 |
"schema": { |
341 |
"$ref": "../definitions.json#/error" |
342 |
} |
343 |
} |
344 |
}, |
345 |
"x-koha-authorization": { |
346 |
"permissions": { |
347 |
"parameters": "manage_bookings" |
348 |
} |
349 |
} |
350 |
} |
351 |
} |
352 |
} |