Bug 29290: Add spec changes
[koha.git] / api / v1 / swagger / paths / biblios.json
1 {
2   "/biblios/{biblio_id}": {
3     "get": {
4       "x-mojo-to": "Biblios#get",
5       "operationId": "getBiblio",
6       "tags": [ "biblios" ],
7       "summary": "Get biblio",
8       "parameters": [
9         {
10           "$ref": "../parameters.json#/biblio_id_pp"
11         }
12       ],
13       "produces": [
14         "application/json",
15         "application/marcxml+xml",
16         "application/marc-in-json",
17         "application/marc",
18         "text/plain"
19       ],
20       "responses": {
21         "200": {
22           "description": "A biblio"
23         },
24         "401": {
25           "description": "Authentication required",
26           "schema": {
27             "$ref": "../definitions.json#/error"
28           }
29         },
30         "403": {
31           "description": "Access forbidden",
32           "schema": {
33             "$ref": "../definitions.json#/error"
34           }
35         },
36         "404": {
37           "description": "Biblio not found",
38           "schema": {
39             "$ref": "../definitions.json#/error"
40           }
41         },
42         "406": {
43           "description": "Not acceptable",
44           "schema": {
45             "type": "array",
46             "description": "Accepted content-types",
47             "items": {
48                 "type": "string"
49             }
50           }
51         },
52         "500": {
53           "description": "Internal server error",
54           "schema": {
55             "$ref": "../definitions.json#/error"
56           }
57         },
58         "503": {
59           "description": "Under maintenance",
60           "schema": {
61             "$ref": "../definitions.json#/error"
62           }
63         }
64       },
65       "x-koha-authorization": {
66         "permissions": {
67             "catalogue": "1"
68         }
69       }
70     },
71     "delete": {
72       "x-mojo-to": "Biblios#delete",
73       "operationId": "deleteBiblio",
74       "tags": [ "biblios" ],
75       "summary": "Delete biblio",
76       "parameters": [
77         {
78           "$ref": "../parameters.json#/biblio_id_pp"
79         }
80       ],
81       "produces": [
82         "application/json"
83       ],
84       "responses": {
85         "204": {
86           "description": "Biblio deleted",
87           "schema": {
88             "type": "string"
89           }
90         },
91         "401": {
92           "description": "Authentication required",
93           "schema": {
94             "$ref": "../definitions.json#/error"
95           }
96         },
97         "403": {
98           "description": "Access forbidden",
99           "schema": {
100             "$ref": "../definitions.json#/error"
101           }
102         },
103         "404": {
104           "description": "Biblio not found",
105           "schema": {
106             "$ref": "../definitions.json#/error"
107           }
108         },
109         "409": {
110           "description": "Unable to perform action on biblio",
111           "schema": {
112             "$ref": "../definitions.json#/error"
113           }
114         },
115         "500": {
116           "description": "Internal error",
117           "schema": {
118             "$ref": "../definitions.json#/error"
119           }
120         },
121         "503": {
122           "description": "Under maintenance",
123           "schema": {
124             "$ref": "../definitions.json#/error"
125           }
126         }
127       },
128       "x-koha-authorization": {
129         "permissions": {
130           "editcatalogue": "edit_catalogue"
131         }
132       }
133     }
134   },
135   "/biblios/{biblio_id}/checkouts": {
136     "get": {
137       "x-mojo-to": "Biblios#get_checkouts",
138       "operationId": "listBiblioCheckouts",
139       "tags": [
140         "checkouts"
141       ],
142       "summary": "List checkouts for a biblio",
143       "parameters": [
144         {
145           "$ref": "../parameters.json#/biblio_id_pp"
146         },
147         {
148           "$ref": "../parameters.json#/page"
149         },
150         {
151           "$ref": "../parameters.json#/per_page"
152         },
153         {
154           "$ref": "../parameters.json#/match"
155         },
156         {
157           "$ref": "../parameters.json#/order_by"
158         },
159         {
160           "$ref": "../parameters.json#/q_param"
161         },
162         {
163           "$ref": "../parameters.json#/q_body"
164         },
165         {
166           "$ref": "../parameters.json#/q_header"
167         },
168         {
169           "name": "checked_in",
170           "in": "query",
171           "description": "By default, current checkouts are returned, when this is true then checked in checkouts are returned as result.",
172           "type": "boolean"
173         }
174       ],
175       "produces": [
176         "application/json"
177       ],
178       "responses": {
179         "200": {
180           "description": "A list of checkouts",
181           "schema": {
182             "$ref": "../definitions.json#/checkouts"
183           }
184         },
185         "403": {
186           "description": "Access forbidden",
187           "schema": {
188             "$ref": "../definitions.json#/error"
189           }
190         },
191         "404": {
192           "description": "Biblio not found",
193           "schema": {
194             "$ref": "../definitions.json#/error"
195           }
196         }
197       },
198       "x-koha-authorization": {
199         "permissions": {
200           "circulate": "circulate_remaining_permissions"
201         }
202       },
203       "x-koha-embed": [
204         "issuer",
205         "item",
206         "patron",
207         "library"
208       ]
209     }
210   },
211   "/biblios/{biblio_id}/items": {
212     "get": {
213       "x-mojo-to": "Biblios#get_items",
214       "operationId": "getBiblioItems",
215       "tags": [
216         "biblios"
217       ],
218       "summary": "Get items for a biblio",
219       "parameters": [
220         {
221           "$ref": "../parameters.json#/biblio_id_pp"
222         },
223         {
224           "$ref": "../parameters.json#/match"
225         },
226         {
227           "$ref": "../parameters.json#/order_by"
228         },
229         {
230           "$ref": "../parameters.json#/page"
231         },
232         {
233           "$ref": "../parameters.json#/per_page"
234         },
235         {
236           "$ref": "../parameters.json#/q_param"
237         },
238         {
239           "$ref": "../parameters.json#/q_body"
240         },
241         {
242           "$ref": "../parameters.json#/q_header"
243         }
244       ],
245       "consumes": [
246         "application/json"
247       ],
248       "produces": [
249         "application/json"
250       ],
251       "responses": {
252         "200": {
253           "description": "A list of the items attached to the record",
254           "schema": {
255             "type": "array",
256             "items": {
257               "$ref": "../definitions.json#/item"
258             }
259           }
260         },
261         "401": {
262           "description": "Authentication required",
263           "schema": {
264             "$ref": "../definitions.json#/error"
265           }
266         },
267         "403": {
268           "description": "Access forbidden",
269           "schema": {
270             "$ref": "../definitions.json#/error"
271           }
272         },
273         "404": {
274           "description": "Biblio not found",
275           "schema": {
276             "$ref": "../definitions.json#/error"
277           }
278         },
279         "406": {
280           "description": "Not acceptable",
281           "schema": {
282             "type": "array",
283             "description": "Accepted content-types",
284             "items": {
285                 "type": "string"
286             }
287           }
288         },
289         "500": {
290           "description": "Internal server error",
291           "schema": {
292             "$ref": "../definitions.json#/error"
293           }
294         },
295         "503": {
296           "description": "Under maintenance",
297           "schema": {
298             "$ref": "../definitions.json#/error"
299           }
300         }
301       },
302       "x-koha-authorization": {
303         "permissions": {
304             "catalogue": "1"
305         }
306       }
307     }
308   },
309   "/biblios/{biblio_id}/pickup_locations": {
310     "get": {
311       "x-mojo-to": "Biblios#pickup_locations",
312       "operationId": "getBiblioPickupLocations",
313       "tags": [
314         "biblios"
315       ],
316       "summary": "Get valid pickup locations for a biblio",
317       "parameters": [
318         {
319           "$ref": "../parameters.json#/biblio_id_pp"
320         },
321         {
322           "name": "patron_id",
323           "in": "query",
324           "description": "Internal patron identifier",
325           "required": true,
326           "type": "integer"
327         },
328         {
329           "$ref": "../parameters.json#/match"
330         },
331         {
332           "$ref": "../parameters.json#/order_by"
333         },
334         {
335           "$ref": "../parameters.json#/page"
336         },
337         {
338           "$ref": "../parameters.json#/per_page"
339         },
340         {
341           "$ref": "../parameters.json#/q_param"
342         },
343         {
344           "$ref": "../parameters.json#/q_body"
345         },
346         {
347           "$ref": "../parameters.json#/q_header"
348         }
349       ],
350       "consumes": [
351         "application/json"
352       ],
353       "produces": [
354         "application/json"
355       ],
356       "responses": {
357         "200": {
358           "description": "Biblio pickup locations",
359           "schema": {
360             "type": "array",
361             "items": {
362               "$ref": "../definitions.json#/library"
363             }
364           }
365         },
366         "400": {
367           "description": "Missing or wrong parameters",
368           "schema": {
369             "$ref": "../definitions.json#/error"
370           }
371         },
372         "401": {
373           "description": "Authentication required",
374           "schema": {
375             "$ref": "../definitions.json#/error"
376           }
377         },
378         "403": {
379           "description": "Access forbidden",
380           "schema": {
381             "$ref": "../definitions.json#/error"
382           }
383         },
384         "404": {
385           "description": "Biblio not found",
386           "schema": {
387             "$ref": "../definitions.json#/error"
388           }
389         },
390         "500": {
391           "description": "Internal server error",
392           "schema": {
393             "$ref": "../definitions.json#/error"
394           }
395         },
396         "503": {
397           "description": "Under maintenance",
398           "schema": {
399             "$ref": "../definitions.json#/error"
400           }
401         }
402       },
403       "x-koha-authorization": {
404         "permissions": {
405           "reserveforothers": "place_holds"
406         }
407       }
408     }
409   },
410   "/public/biblios/{biblio_id}": {
411     "get": {
412       "x-mojo-to": "Biblios#get_public",
413       "operationId": "getBiblioPublic",
414       "tags": [
415         "biblios"
416       ],
417       "summary": "Get biblio (public)",
418       "parameters": [
419         {
420           "$ref": "../parameters.json#/biblio_id_pp"
421         }
422       ],
423       "produces": [
424         "application/marcxml+xml",
425         "application/marc-in-json",
426         "application/marc",
427         "text/plain"
428       ],
429       "responses": {
430         "200": {
431           "description": "A biblio"
432         },
433         "401": {
434           "description": "Authentication required",
435           "schema": {
436             "$ref": "../definitions.json#/error"
437           }
438         },
439         "403": {
440           "description": "Access forbidden",
441           "schema": {
442             "$ref": "../definitions.json#/error"
443           }
444         },
445         "404": {
446           "description": "Biblio not found",
447           "schema": {
448             "$ref": "../definitions.json#/error"
449           }
450         },
451         "406": {
452           "description": "Not acceptable",
453           "schema": {
454             "type": "array",
455             "description": "Accepted content-types",
456             "items": {
457                 "type": "string"
458             }
459           }
460         },
461         "500": {
462           "description": "Internal server error",
463           "schema": {
464             "$ref": "../definitions.json#/error"
465           }
466         },
467         "503": {
468           "description": "Under maintenance",
469           "schema": {
470             "$ref": "../definitions.json#/error"
471           }
472         }
473       }
474     }
475   },
476   "/public/biblios/{biblio_id}/items": {
477     "get": {
478       "x-mojo-to": "Biblios#get_items_public",
479       "operationId": "getBiblioItemsPublic",
480       "tags": [
481         "biblios",
482         "items"
483       ],
484       "parameters": [
485         {
486           "$ref": "../parameters.json#/biblio_id_pp"
487         },
488         {
489           "$ref": "../parameters.json#/match"
490         },
491         {
492           "$ref": "../parameters.json#/order_by"
493         },
494         {
495           "$ref": "../parameters.json#/page"
496         },
497         {
498           "$ref": "../parameters.json#/per_page"
499         },
500         {
501           "$ref": "../parameters.json#/q_param"
502         },
503         {
504           "$ref": "../parameters.json#/q_body"
505         },
506         {
507           "$ref": "../parameters.json#/q_header"
508         }
509       ],
510       "consumes": [
511         "application/json"
512       ],
513       "produces": [
514         "application/json"
515       ],
516       "responses": {
517         "200": {
518           "description": "A list of the items attached to the record",
519           "schema": {
520             "type": "array",
521             "items": {
522               "$ref": "../definitions.json#/item"
523             }
524           }
525         },
526         "401": {
527           "description": "Authentication required",
528           "schema": {
529             "$ref": "../definitions.json#/error"
530           }
531         },
532         "403": {
533           "description": "Access forbidden",
534           "schema": {
535             "$ref": "../definitions.json#/error"
536           }
537         },
538         "404": {
539           "description": "Biblio not found",
540           "schema": {
541             "$ref": "../definitions.json#/error"
542           }
543         },
544         "406": {
545           "description": "Not acceptable",
546           "schema": {
547             "type": "array",
548             "description": "Accepted content-types",
549             "items": {
550                 "type": "string"
551             }
552           }
553         },
554         "500": {
555           "description": "Internal server error",
556           "schema": {
557             "$ref": "../definitions.json#/error"
558           }
559         },
560         "503": {
561           "description": "Under maintenance",
562           "schema": {
563             "$ref": "../definitions.json#/error"
564           }
565         }
566       }
567     }
568   }
569 }