-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathswagger.yaml
371 lines (369 loc) · 10.2 KB
/
swagger.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
openapi: 3.0.0
info:
title: helpbuttons.org
description: API description
version: 2.0.0
paths:
/users/login:
post:
summary: Login to your account
tags:
- users
description: With your client id and secret, you can retrieve an access and refresh tokens.
requestBody:
content:
application/json:
schema:
title: login
type: object
properties:
client_id:
type: string
client_secret:
type: string
username:
type: string
description: immutable name of the user, used to find or mention its actor
password:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
token:
type: string
example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca917t8dsab7
404:
description: User not found
401:
description: Unauthorized
/users/register:
post:
summary: register a new account
tags:
- users
description: As a visitor, you can use this API to open an account (if registrations are open on that PeerTube instance). As an admin, you should use the dedicated User creation API instead.
requestBody:
content:
application/json:
schema:
title: a new user
type: object
properties:
email:
type: string
description: email of the user, used for login or service communications
password:
type: string
description: password
username:
type: string
description: immutable name of the user, used to find or mention its actor
displayName:
type: string
description: editable name of the user, displayed in its representations
responses:
200:
description: OK
/users/{id}/verify-email:
post:
summary: verify an email
tags:
- users
description: Following a user registration, the new user will receive an email asking to click a link containing a secret.
parameters:
- in: path
name: id
schema:
type: integer
required: true
description: user id
requestBody:
content:
application/json:
schema:
type: object
properties:
verificationString:
type: string
responses:
200:
description: OK
/users/{username}/resend-verification-link:
post:
summary: resend verification link
tags:
- users
parameters:
- in: path
name: username
schema:
type: string
required: true
description: username
responses:
200:
description: OK
/users/destroy:
delete:
summary: delete user account
tags:
- users
security:
- tokenAuth: []
responses:
200:
description: OK
401:
$ref: "#/components/responses/UnauthorizedError"
/users/logout:
post:
summary: Logout
tags:
- users
security:
- tokenAuth: []
requestBody:
content:
application/json:
schema:
title: login
type: object
properties:
access_token:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
status:
type: integer
401:
$ref: "#/components/responses/UnauthorizedError"
/users/recover-account:
post:
summary: Recover an account [TO REVIEW]
tags:
- users
requestBody:
content:
application/json:
schema:
type: object
properties:
email:
type: string
responses:
200:
description: OK
401:
$ref: "#/components/responses/UnauthorizedError"
/networks/new:
post:
summary: Create a new network
tags:
- networks
security:
- tokenAuth: []
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
url:
type: string
avatar:
type: string
description:
type: string
privacy:
type: string
enum:
- private
- public
place:
type: string
latitude:
type: number
longitude:
type: number
radius:
type: number
template:
type: string
examples:
network:
summary: example of a new network
value:
name: "Network of animal support Andalucia"
url: "https://andaluciaanimal.org"
avatar: "/image/gfdusigfsdg7f8dsf"
description: "a network where you can support animals in need in andalucia and report animals that need support"
privacy: "private"
place: "Andalucia"
latitude: -9.1790771484375
longitude: 38.81831117374662
radius: "50km"
template: "toBeDefinedByFrontend"
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
slug:
type: string
example: 'network_of_animal_support_andalucia'
401:
$ref: "#/components/responses/UnauthorizedError"
/networks/destroy:
delete:
summary: destroy a network
tags:
- networks
security:
- tokenAuth: []
responses:
200:
description: OK
401:
$ref: "#/components/responses/UnauthorizedError"
/buttons/new/{type}:
post:
summary: Create a new button
tags:
- buttons
security:
- tokenAuth: []
parameters:
- in: path
name: type
schema:
type: string
enum:
- offer
- need
- exchange
required: true
requestBody:
content:
application/json:
schema:
type: object
properties:
tags:
type: array
items:
type: string
description:
type: string
latitude:
type: number
longitude:
type: number
templateData:
type: string
examples:
button:
summary: example button
value:
networks: ['network_of_animal_support_andalucia', 'yet_another_network']
type: 'need'
tags: ['people','dog', 'abandoned', 'food']
description: 'Im out of the neighborhood during next weeks, and i cant feed the dog'
latitude: -0.2323
longitude: 9.878788
templateData: {
"date": "\"2021-09-01T12:12:00.000Z\"",
"coordinates_radius": "10km",
"description": "there is this lonely dog without any leash needing food",
"history_of_status": [
{
"status": "the dog was fed with food",
"date": "\"2021-09-01T12:12:00.000Z\"",
"latitude": "12.032",
"longitude": "89372932.3"
},
{
"status": "i didnt had any food for the dog, if some1 can check on him later",
"date": "\"2021-09-01T09:12:00.000Z\"",
"latitude": "12.032",
"longitude": "89372932.3"
}
]
}
responses:
200:
description: OK
content:
application/json:
schema:
type: object
properties:
slug:
type: string
example: 'dog_help'
401:
$ref: "#/components/responses/UnauthorizedError"
/buttons/destroy:
delete:
summary: destroy a button
tags:
- buttons
security:
- tokenAuth: []
responses:
200:
description: OK
401:
$ref: "#/components/responses/UnauthorizedError"
/images/new:
post:
summary: uploads a new image
tags:
- images
security:
- tokenAuth: []
requestBody:
content:
image/*:
schema:
type: string
format: binary
responses:
200:
description: OK
401:
description: Unauthorized
/images/destroy:
delete:
summary: delete an image
tags:
- images
responses:
200:
description: OK
401:
description: Unauthorized
components:
securitySchemes:
tokenAuth:
type: apiKey
in: query
name: token
responses:
UnauthorizedError:
description: token is missing, please login to get a token