Bug 28842: A summary to the /items/:item_id/pickup_locations route
[koha.git] / api / v1 / swagger / paths / items.json
1 {
2   "/items": {
3     "get": {
4       "x-mojo-to": "Items#list",
5       "operationId": "listItems",
6       "tags": [
7         "items"
8       ],
9       "summary": "List items",
10       "parameters": [
11         {
12           "name": "external_id",
13           "in": "query",
14           "description": "Search on the item's barcode",
15           "required": false,
16           "type": "string"
17         },
18         {
19           "$ref": "../parameters.json#/match"
20         },
21         {
22           "$ref": "../parameters.json#/order_by"
23         },
24         {
25           "$ref": "../parameters.json#/page"
26         },
27         {
28           "$ref": "../parameters.json#/per_page"
29         }
30       ],
31       "consumes": [
32         "application/json"
33       ],
34       "produces": [
35         "application/json"
36       ],
37       "responses": {
38         "200": {
39           "description": "A list of item",
40           "schema": {
41             "type": "array",
42             "items": {
43               "$ref": "../definitions.json#/item"
44             }
45           }
46         },
47         "401": {
48           "description": "Authentication required",
49           "schema": {
50             "$ref": "../definitions.json#/error"
51           }
52         },
53         "403": {
54           "description": "Access forbidden",
55           "schema": {
56             "$ref": "../definitions.json#/error"
57           }
58         },
59         "500": {
60           "description": "Internal server error",
61           "schema": {
62             "$ref": "../definitions.json#/error"
63           }
64         },
65         "503": {
66           "description": "Under maintenance",
67           "schema": {
68             "$ref": "../definitions.json#/error"
69           }
70         }
71       },
72       "x-koha-authorization": {
73         "permissions": {
74           "catalogue": "1"
75         }
76       }
77     }
78   },
79   "/items/{item_id}": {
80     "get": {
81       "x-mojo-to": "Items#get",
82       "operationId": "getItem",
83       "tags": ["items"],
84       "summary": "Get item",
85       "parameters": [{
86           "$ref": "../parameters.json#/item_id_pp"
87         }
88       ],
89       "consumes": ["application/json"],
90       "produces": ["application/json"],
91       "responses": {
92         "200": {
93           "description": "An item",
94           "schema": {
95             "$ref": "../definitions.json#/item"
96           }
97         },
98         "400": {
99           "description": "Missing or wrong parameters",
100           "schema": {
101             "$ref": "../definitions.json#/error"
102           }
103         },
104         "404": {
105           "description": "Item not found",
106           "schema": {
107             "$ref": "../definitions.json#/error"
108           }
109         },
110         "500": {
111           "description": "Internal server error",
112           "schema": {
113             "$ref": "../definitions.json#/error"
114           }
115         },
116         "503": {
117           "description": "Under maintenance",
118           "schema": {
119             "$ref": "../definitions.json#/error"
120           }
121         }
122       },
123       "x-koha-authorization": {
124         "permissions": {
125           "catalogue": "1"
126         }
127       }
128     }
129   },
130   "/items/{item_id}/pickup_locations": {
131     "get": {
132       "x-mojo-to": "Items#pickup_locations",
133       "operationId": "getItemPickupLocations",
134       "summary": "Get valid pickup locations for an item",
135       "tags": ["items"],
136       "parameters": [
137         {
138           "$ref": "../parameters.json#/item_id_pp"
139         },
140         {
141           "name": "patron_id",
142           "in": "query",
143           "description": "Internal patron identifier",
144           "required": true,
145           "type": "integer"
146         },
147         {
148           "$ref": "../parameters.json#/match"
149         },
150         {
151           "$ref": "../parameters.json#/order_by"
152         },
153         {
154           "$ref": "../parameters.json#/page"
155         },
156         {
157           "$ref": "../parameters.json#/per_page"
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       "consumes": [
170         "application/json"
171       ],
172       "produces": [
173         "application/json"
174       ],
175       "responses": {
176         "200": {
177           "description": "Item pickup locations",
178           "schema": {
179             "type": "array",
180             "items": {
181               "$ref": "../definitions.json#/library"
182             }
183           }
184         },
185         "400": {
186           "description": "Missing or wrong parameters",
187           "schema": {
188             "$ref": "../definitions.json#/error"
189           }
190         },
191         "401": {
192           "description": "Authentication required",
193           "schema": {
194             "$ref": "../definitions.json#/error"
195           }
196         },
197         "403": {
198           "description": "Access forbidden",
199           "schema": {
200             "$ref": "../definitions.json#/error"
201           }
202         },
203         "404": {
204           "description": "Biblio not found",
205           "schema": {
206             "$ref": "../definitions.json#/error"
207           }
208         },
209         "500": {
210           "description": "Internal server error",
211           "schema": {
212             "$ref": "../definitions.json#/error"
213           }
214         },
215         "503": {
216           "description": "Under maintenance",
217           "schema": {
218             "$ref": "../definitions.json#/error"
219           }
220         }
221       },
222       "x-koha-authorization": {
223         "permissions": {
224           "reserveforothers": "place_holds"
225         }
226       }
227     }
228   }
229 }