1457788163cc28318fd69a4205f0e59d84e7b7a3
[koha.git] / api / v1 / swagger / paths / libraries.json
1 {
2   "/libraries": {
3     "get": {
4       "x-mojo-to": "Library#list",
5       "operationId": "listLibrary",
6       "tags": ["library"],
7       "parameters": [{
8         "name": "branchname",
9         "in": "query",
10         "description": "Case insensitive 'starts-with' search on name",
11         "required": false,
12         "type": "string"
13       }, {
14         "name": "branchaddress1",
15         "in": "query",
16         "description": "Case insensitive 'starts-with' search on address1",
17         "required": false,
18         "type": "string"
19       }, {
20         "name": "branchaddress2",
21         "in": "query",
22         "description": "Case insensitive 'starts-with' search on address2",
23         "required": false,
24         "type": "string"
25       }, {
26         "name": "branchaddress3",
27         "in": "query",
28         "description": "Case insensitive 'starts-with' search on address3",
29         "required": false,
30         "type": "string"
31       }, {
32         "name": "branchzip",
33         "in": "query",
34         "description": "Case insensitive 'starts-with' search on zipcode",
35         "required": false,
36         "type": "string"
37       }, {
38         "name": "branchcity",
39         "in": "query",
40         "description": "Case insensitive 'starts-with' search on city",
41         "required": false,
42         "type": "string"
43       }, {
44         "name": "branchstate",
45         "in": "query",
46         "description": "Case insensitive 'starts-with' search on state",
47         "required": false,
48         "type": "string"
49       }, {
50         "name": "branchcountry",
51         "in": "query",
52         "description": "Case insensitive 'starts_with' search on country",
53         "required": false,
54         "type": "string"
55       }, {
56         "name": "branchphone",
57         "in": "query",
58         "description": "Case insensitive 'starts_with' search on phone number",
59         "required": false,
60         "type": "string"
61       }, {
62         "name": "branchfax",
63         "in": "query",
64         "description": "Case insensitive 'starts_with' search on fax number",
65         "required": false,
66         "type": "string"
67       }, {
68         "name": "branchemail",
69         "in": "query",
70         "description": "Case insensitive 'starts_with' search on email address",
71         "required": false,
72         "type": "string"
73       }, {
74         "name": "branchreplyto",
75         "in": "query",
76         "description": "Case insensitive 'starts_with' search on Reply-To email address",
77         "required": false,
78         "type": "string"
79       }, {
80         "name": "branchreturnpath",
81         "in": "query",
82         "description": "Case insensitive 'starts_with' search on Return-Path email address",
83         "required": false,
84         "type": "string"
85       }, {
86         "name": "branchurl",
87         "in": "query",
88         "description": "Case insensitive 'starts_with' search on website URL",
89         "required": false,
90         "type": "string"
91       }, {
92         "name": "issuing",
93         "in": "query",
94         "description": "Unused in Koha",
95         "required": false,
96         "type": "integer"
97       }, {
98         "name": "branchip",
99         "in": "query",
100         "description": "Case insensitive 'starts_with' search on IP address",
101         "required": false,
102         "type": "string"
103       }, {
104         "name": "branchprinter",
105         "in": "query",
106         "description": "Unused in Koha",
107         "required": false,
108         "type": "string"
109       }, {
110         "name": "branchnotes",
111         "in": "query",
112         "description": "Case insensitive 'starts_with' search on notes",
113         "required": false,
114         "type": "string"
115       }, {
116         "name": "opac_info",
117         "in": "query",
118         "description": "Case insensitive 'starts-with' search on OPAC info",
119         "required": false,
120         "type": "string"
121       }],
122       "produces": [
123         "application/json"
124       ],
125       "responses": {
126         "200": {
127           "description": "A list of libraries",
128           "schema": {
129             "type": "array",
130             "items": {
131               "$ref": "../definitions.json#/library"
132             }
133           }
134         },
135         "500": {
136           "description": "Internal error",
137           "schema": {
138             "$ref": "../definitions.json#/error"
139           }
140         },
141         "503": {
142           "description": "Under maintenance",
143           "schema": {
144             "$ref": "../definitions.json#/error"
145           }
146         }
147       }
148     },
149     "post": {
150       "x-mojo-to": "Library#add",
151       "operationId": "addLibrary",
152       "tags": ["library"],
153       "parameters": [{
154         "name": "body",
155         "in": "body",
156         "description": "A JSON object containing informations about the new library",
157         "required": true,
158         "schema": {
159           "$ref": "../definitions.json#/library"
160         }
161       }],
162       "produces": [
163         "application/json"
164       ],
165       "responses": {
166         "201": {
167           "description": "Library added",
168           "schema": {
169             "$ref": "../definitions.json#/library"
170           }
171         },
172         "400": {
173           "description": "Bad request",
174           "schema": {
175             "$ref": "../definitions.json#/error"
176           }
177         },
178         "401": {
179           "description": "Authentication required",
180           "schema": {
181             "$ref": "../definitions.json#/error"
182           }
183         },
184         "403": {
185           "description": "Access forbidden",
186           "schema": {
187             "$ref": "../definitions.json#/error"
188           }
189         },
190         "500": {
191           "description": "Internal error",
192           "schema": {
193             "$ref": "../definitions.json#/error"
194           }
195         },
196         "503": {
197           "description": "Under maintenance",
198           "schema": {
199             "$ref": "../definitions.json#/error"
200           }
201         }
202       },
203       "x-koha-authorization": {
204         "permissions": {
205           "parameters": "parameters_remaining_permissions"
206         }
207       }
208     }
209   },
210   "/libraries/{branchcode}": {
211     "get": {
212       "x-mojo-to": "Library#get",
213       "operationId": "getLibrary",
214       "tags": ["library"],
215       "parameters": [
216         {
217           "$ref": "../parameters.json#/branchcodePathParam"
218         }
219       ],
220       "produces": [
221         "application/json"
222       ],
223       "responses": {
224         "200": {
225           "description": "A library",
226           "schema": {
227             "$ref": "../definitions.json#/library"
228           }
229         },
230         "404": {
231           "description": "Library not found",
232           "schema": {
233             "$ref": "../definitions.json#/error"
234           }
235         }
236       }
237     },
238     "put": {
239       "x-mojo-to": "Library#update",
240       "operationId": "updateLibrary",
241       "tags": ["library"],
242       "parameters": [{
243         "$ref": "../parameters.json#/branchcodePathParam"
244       }, {
245         "name": "body",
246         "in": "body",
247         "description": "A JSON object containing information on the library",
248         "required": true,
249         "schema": {
250           "$ref": "../definitions.json#/library"
251         }
252       }],
253       "consumes": [
254         "application/json"
255       ],
256       "produces": [
257         "application/json"
258       ],
259       "responses": {
260         "200": {
261           "description": "A library",
262           "schema": {
263             "$ref": "../definitions.json#/library"
264           }
265         },
266         "400": {
267           "description": "Bad request",
268           "schema": {
269             "$ref": "../definitions.json#/error"
270           }
271         },
272         "401": {
273           "description": "Authentication required",
274           "schema": {
275             "$ref": "../definitions.json#/error"
276           }
277         },
278         "403": {
279           "description": "Access forbidden",
280           "schema": {
281             "$ref": "../definitions.json#/error"
282           }
283         },
284         "404": {
285           "description": "Library not found",
286           "schema": {
287             "$ref": "../definitions.json#/error"
288           }
289         },
290         "500": {
291           "description": "Internal error",
292           "schema": {
293             "$ref": "../definitions.json#/error"
294           }
295         },
296         "503": {
297           "description": "Under maintenance",
298           "schema": {
299             "$ref": "../definitions.json#/error"
300           }
301         }
302       },
303       "x-koha-authorization": {
304         "permissions": {
305           "parameters": "parameters_remaining_permissions"
306         }
307       }
308     },
309     "delete": {
310       "x-mojo-to": "Library#delete",
311       "operationId": "deleteLibrary",
312       "tags": ["library"],
313       "parameters": [{
314         "$ref": "../parameters.json#/branchcodePathParam"
315       }],
316       "produces": [
317         "application/json"
318       ],
319       "responses": {
320         "204": {
321           "description": "Library deleted",
322           "schema": { "type": "string" }
323         },
324         "401": {
325           "description": "Authentication required",
326           "schema": {
327             "$ref": "../definitions.json#/error"
328           }
329         },
330         "403": {
331           "description": "Access forbidden",
332           "schema": {
333             "$ref": "../definitions.json#/error"
334           }
335         },
336         "404": {
337           "description": "Library not found",
338           "schema": {
339             "$ref": "../definitions.json#/error"
340           }
341         },
342         "500": {
343           "description": "Internal error",
344           "schema": {
345             "$ref": "../definitions.json#/error"
346           }
347         },
348         "503": {
349           "description": "Under maintenance",
350           "schema": {
351             "$ref": "../definitions.json#/error"
352           }
353         }
354       },
355       "x-koha-authorization": {
356         "permissions": {
357           "parameters": "parameters_remaining_permissions"
358         }
359       }
360     }
361   }
362 }