Bug 29620: Move the OpenAPI spec to YAML format
[koha.git] / api / v1 / swagger / paths / quotes.yaml
1 ---
2 /quotes:
3   get:
4     x-mojo-to: Quotes#list
5     operationId: listQuotes
6     tags:
7       - quotes
8     summary: List quotes
9     produces:
10       - application/json
11     parameters:
12       - name: quote_id
13         in: query
14         description: Case insensitive search on quote id
15         required: false
16         type: string
17       - name: source
18         in: query
19         description: Case insensitive search on source
20         required: false
21         type: string
22       - name: text
23         in: query
24         description: Case insensitive search on text
25         required: false
26         type: string
27       - name: displayed_on
28         in: query
29         description: Case Insensative search on last displayed date
30         required: false
31         type: string
32       - $ref: ../parameters.yaml#/match
33       - $ref: ../parameters.yaml#/order_by
34       - $ref: ../parameters.yaml#/page
35       - $ref: ../parameters.yaml#/per_page
36       - $ref: ../parameters.yaml#/q_param
37       - $ref: ../parameters.yaml#/q_body
38       - $ref: ../parameters.yaml#/q_header
39     responses:
40       "200":
41         description: A list of quotes
42         schema:
43           type: array
44           items:
45             $ref: ../definitions.yaml#/quote
46       "403":
47         description: Access forbidden
48         schema:
49           $ref: ../definitions.yaml#/error
50       "500":
51         description: Internal error
52         schema:
53           $ref: ../definitions.yaml#/error
54       "503":
55         description: Under maintenance
56         schema:
57           $ref: ../definitions.yaml#/error
58     x-koha-authorization:
59       permissions:
60         catalogue: "1"
61   post:
62     x-mojo-to: Quotes#add
63     operationId: addQuote
64     tags:
65       - quotes
66     summary: Add quote
67     parameters:
68       - name: body
69         in: body
70         description: A JSON object containing informations about the new quote
71         required: true
72         schema:
73           $ref: ../definitions.yaml#/quote
74     produces:
75       - application/json
76     responses:
77       "201":
78         description: Quote added
79         schema:
80           $ref: ../definitions.yaml#/quote
81       "401":
82         description: Authentication required
83         schema:
84           $ref: ../definitions.yaml#/error
85       "403":
86         description: Access forbidden
87         schema:
88           $ref: ../definitions.yaml#/error
89       "500":
90         description: Internal error
91         schema:
92           $ref: ../definitions.yaml#/error
93       "503":
94         description: Under maintenance
95         schema:
96           $ref: ../definitions.yaml#/error
97     x-koha-authorization:
98       permissions:
99         tools: edit_quotes
100 "/quotes/{quote_id}":
101   get:
102     x-mojo-to: Quotes#get
103     operationId: getQuote
104     tags:
105       - quotes
106     summary: Get quote
107     parameters:
108       - $ref: ../parameters.yaml#/quote_id_pp
109     produces:
110       - application/json
111     responses:
112       "200":
113         description: A Quote
114         schema:
115           $ref: ../definitions.yaml#/quote
116       "404":
117         description: Quote not found
118         schema:
119           $ref: ../definitions.yaml#/error
120       "500":
121         description: Internal error
122         schema:
123           $ref: ../definitions.yaml#/error
124       "503":
125         description: Under maintenance
126         schema:
127           $ref: ../definitions.yaml#/error
128     x-koha-authorization:
129       permissions:
130         catalogue: "1"
131   put:
132     x-mojo-to: Quotes#update
133     operationId: updateQuote
134     tags:
135       - quotes
136     summary: Update quote
137     parameters:
138       - $ref: ../parameters.yaml#/quote_id_pp
139       - name: body
140         in: body
141         description: a quote object
142         required: true
143         schema:
144           $ref: ../definitions.yaml#/quote
145     produces:
146       - application/json
147     responses:
148       "200":
149         description: A quote
150         schema:
151           $ref: ../definitions.yaml#/quote
152       "401":
153         description: Authentication required
154         schema:
155           $ref: ../definitions.yaml#/error
156       "403":
157         description: Access forbidden
158         schema:
159           $ref: ../definitions.yaml#/error
160       "404":
161         description: Quote not found
162         schema:
163           $ref: ../definitions.yaml#/error
164       "500":
165         description: Internal error
166         schema:
167           $ref: ../definitions.yaml#/error
168       "503":
169         description: Under maintenance
170         schema:
171           $ref: ../definitions.yaml#/error
172     x-koha-authorization:
173       permissions:
174         tools: edit_quotes
175   delete:
176     x-mojo-to: Quotes#delete
177     operationId: deleteQuote
178     tags:
179       - quotes
180     summary: Delete quote
181     parameters:
182       - $ref: ../parameters.yaml#/quote_id_pp
183     produces:
184       - application/json
185     responses:
186       "204":
187         description: Quote deleted
188       "401":
189         description: Authentication required
190         schema:
191           $ref: ../definitions.yaml#/error
192       "403":
193         description: Access forbidden
194         schema:
195           $ref: ../definitions.yaml#/error
196       "404":
197         description: Quote not found
198         schema:
199           $ref: ../definitions.yaml#/error
200       "500":
201         description: Internal error
202         schema:
203           $ref: ../definitions.yaml#/error
204       "503":
205         description: Under maintenance
206         schema:
207           $ref: ../definitions.yaml#/error
208     x-koha-authorization:
209       permissions:
210         tools: edit_quotes