forked from onmax/tryit-api-doc-tmp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
873 lines (839 loc) · 23 KB
/
openapi.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
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
openapi: 3.0.0
servers:
- description: Server which hosts the API
url: https://congresotryit.es
info:
description: Official API for the Try IT! congress' website
version: "1.0.2"
title: Try IT! API
contact:
email: [email protected]
license:
name: Apache 2.0
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
tags:
- name: Home
description: General Information required at any given page within the website.
- name: Editions
description: Information regarding specific editions.
- name: Tickets
description: Information regarding the generation and checking of tickets.
- name: Awards
description: Information regarding the different awards.
- name: Attendance
description: Information regarding attendance.
paths:
/streaming:
get:
tags:
- Home
summary: Returns a JSON object with streaming information.
operationId: getStreaming
description: |
Returns information regarding current streaming status. If the congress is currently streaming, retrieves the url of the livestream.
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/StreamingResource"
"204":
description: Livestream not currently available.
/editions:
get:
tags:
- Editions
summary: Returns a JSON object with all editions
operationId: getEditions
description: |
Returns a JSON object with all editions.
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/EditionsResource"
/editions/{year}:
get:
tags:
- Editions
summary: Returns a JSON object with info about a specific edition.
operationId: getYearEdition
description: |
Returns a JSON object with information regarding a specific edition
parameters:
- in: path
name: year
description: Year of the edition
required: true
schema:
type: integer
example: 2020
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/YearResource"
/editions/{year}/sponsors:
get:
tags:
- Editions
summary: Returns a JSON object with all sponsors (companies/organizations) for the specified edition
operationId: getSponsors
description: |
Returns the information of all sponsors for the specified edition. Sponsors will be classified by the type of sponsorship.
parameters:
- in: path
name: year
description: Year of the edition
required: true
schema:
type: integer
example: 2020
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/SponsorsResource"
/editions/{year}/speakers/:
get:
tags:
- Editions
summary: Returns a JSON object with all speakers for the specified edition
operationId: getSpeakers
description: |
Returns the information of all speakers (people) of a specific edition.
parameters:
- in: path
name: year
description: Year of the edition
required: true
schema:
type: integer
example: 2020
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/SponsorsResource"
/editions/{year}/talks:
get:
tags:
- Editions
summary: Returns a JSON object with all the talks
operationId: getTalks
description: |
Returns the information of the talks
parameters:
- in: path
name: year
description: Year of the edition
required: true
schema:
type: integer
example: 2020
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/TalkResource"
/editions/{year}/workshops:
get:
tags:
- Editions
summary: Returns a JSON object with all the workshops
operationId: getWorkshops
description: |
Returns the information of the workshops
parameters:
- in: path
name: year
description: Year of the edition
required: true
schema:
type: integer
example: 2020
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/WorkshopResource"
/editions/{year}/schedule:
get:
tags:
- Editions
summary: Returns a schedule with all the events in the specified edition
operationId: getEvents
description: |
Returns a schedule with all the events in the given edition.
parameters:
- in: path
name: year
description: Year of the edition
required: true
schema:
type: integer
example: 2020
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/ScheduleResource"
/editions/{year}/organizers:
get:
tags:
- Editions
summary: Returns the list of all the organizers
operationId: getOrganizers
description: |
Returns the list of all the organizers
parameters:
- in: path
name: year
description: Year of the edition
required: true
schema:
type: integer
example: 2020
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/OrganizerResource"
/editions/{year}/ects/{nif}:
get:
tags:
- Editions
summary: Returns the amount of ECTS a student obtains
operationId: getECTS
description: |
Returns the list of all the organizers
parameters:
- in: path
name: year
description: Year of the edition
required: true
schema:
type: integer
example: 2020
- in: path
name: nif
description: NIF of the student
required: true
schema:
type: string
example: X255555T
responses:
"200":
description: OK
content:
application/json:
schema:
type: number
example: 1.5
/tickets:
post:
tags:
- Tickets
summary: Creates a new ticket
operationId: postTicket
description: |
Sends the information of the form filled by the user to the server in order to create a new ticket and send him the email with the ticket. It also generates information regarding the distribution.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/TicketResource"
responses:
"201":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/PostSuccessResource"
/tickets/{ticket_id}/distribution:
get:
tags:
- Tickets
summary: Gets the assigned location distribution for an attendee for a specific ticket.
operationId: getDistribution
description: |
Returns the different locations (rooms / classes) to which the attendee is asigned. For example, the student has to go to room "SALON DE ACTOS" on day 1 or "5001" on day 2.
parameters:
- in: path
name: ticket_id
description: ID of the Ticket
required: true
schema:
type: integer
example: 75
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/LocationResource"
/prizes:
get:
tags:
- Awards
summary: From a specified prize scenario, returns an attendee's NIF. (INFO - SENDING ENTIRE PRIZERESOURCE BUT THAT IS NOT NECESSARY)
operationId: getPrize
description: |
It generates a winner for the specified raffle. If a prize is selected, it uses that one. Otherwise (no request body json object), it chooses a random one from a pre-established pool of prizes.
parameters:
- in: query
name: is_global_raffle
description: If false, it indicates that the raffle is for a single event (talk, workshop, ...). If true, it indicates that it has to take into consideration the assistance to all events in the congress.
required: true
schema:
type: boolean
example: false
requestBody:
required: false
content:
application/json:
schema:
$ref: "#/components/schemas/PrizeResource"
responses:
"200":
description: OK
content:
application/json:
schema:
type: string
example: 12345678A
/attendance:
post:
tags:
- Attendance
summary: Sends necessary information to register a user's attendance
operationId: postValidation
description: |
Sends the information in order to check attendance.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/AttendanceResource"
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/PostSuccessResource"
components:
schemas:
EditionsResource:
type: array
items:
type: object
required:
- id
- year
- title
- slogan
- description
- start_date
- end_date
- google_calendar_url
properties:
id:
$ref: "#/components/schemas/IdResource"
year:
type: integer
example: 2020
title:
type: string
example: Try IT! 2020
slogan:
type: string
description:
type: string
start_date:
$ref: "#/components/schemas/DateResource"
end_date:
$ref: "#/components/schemas/DateResource"
google_calendar_url:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
YearResource:
type: object
required:
- id
- year
- title
- slogan
- description
- start_date
- end_date
- google_calendar_url
properties:
id:
$ref: "#/components/schemas/IdResource"
year:
type: integer
example: 2020
title:
type: string
example: Try IT! 2020
slogan:
type: string
description:
type: string
start_date:
$ref: "#/components/schemas/DateResource"
end_date:
$ref: "#/components/schemas/DateResource"
google_calendar_url:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
# TICKET
TicketResource:
type: object
required:
- name
- lastname
- identity
- email
- is_student
- phone
properties:
name:
type: string
example: Iron Man
lastname:
type: string
example: The Best
identity:
type: string
pattern: "[/^[0-9]{8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/|/^[XYZ]{1}[0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/]"
example: 00112233K (DNI) or X0011223T (NIE)
email:
type: string
format: email
example: [email protected]
is_student:
type: boolean
example: true
is_upm_student:
type: boolean
example: true
upm_school:
type: string
example: ETSIINF
degree:
type: string
example: Grado en Ingeniería de Armas Nucleares
year:
type: integer
minimum: 1
maximum: 4
example: 2
phone:
type: string
example: "123456789"
# END TICKET
InvalidTicketResource:
type: object
required:
- status
- message
properties:
status:
type: integer
minimum: 400
maximum: 400
example: 400
string:
type: string
example: The user must have a ticket for the current edition
DateResource:
type: integer
example: 1581089789382
IdResource:
type: integer
example: 812
StreamingResource:
type: object
required:
- title
- url
- streaming
properties:
talk:
$ref: "#/components/schemas/TalkResource"
url:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
example: "https://www.twitch.tv/tryit_upm"
# SPEAKER
SpeakerResource:
type: object
required:
- name
- image
- bio
- organization
properties:
name:
type: string
example: Victor Nieves
bio:
type: string
example: No one knows where he was born
image:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
example: "https://www.images.com/victor"
web:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
example: "https://www.personalweb.com/"
organization:
$ref: "#/components/schemas/OrganizerResource"
social_media:
type: object
properties:
twitter:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
example: "https://twitter.com/IronMan"
facebook:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
example: "https://facebook.com/IronMan"
linkedin:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
example: "https://linkedin.com/IronMan"
github:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
example: "https://github.com/IronMan"
gitlab:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
example: "https://gitlab.com/IronMan"
# END SPEAKER
ScheduleResource:
type: array
items:
type: object
required:
- id
- name
- description
- eventtype
properties:
id:
$ref: "#/components/schemas/IdResource"
name:
type: string
example: Awesome name
description:
type: string
example: Awesome description
eventtype:
type: string
pattern: "talk | workshop | activity"
example: talk
# Event
EventResource:
type: object
required:
- id
- name
- description
- eventtype
properties:
id:
$ref: "#/components/schemas/IdResource"
name:
type: string
example: Awesome name
description:
type: string
example: Awesome description
eventtype:
type: string
pattern: "talk | workshop | activity"
example: talk
ActivityResource:
type: object
required:
- event
- image
- poster
- registration
properties:
event:
$ref: "#/components/schemas/EventResource"
image:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
example: "https://www.image.com/"
poster:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
example: "https://www.image.com/"
registration:
type: boolean
example: True
# TALKS
TalkResource:
type: object
required:
- event
- url
- video
- start_date
- end_date
- slide
- room
- speaker
properties:
event:
$ref: "#/components/schemas/EventResource"
url:
type: string
format: url
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
example: "https://www.ted.com/talks/captain_america_TED_talk"
video:
type: string
format: url
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
example: "https://www.youtube.com/watch?v=ANOTHERONE"
start_date:
$ref: "#/components/schemas/DateResource"
end_date:
$ref: "#/components/schemas/DateResource"
slide:
type: string # VERIFY
format: url
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
example: "https://slide_url.com"
room:
type: string
example: dark room
speakers:
type: array
items:
$ref: "#/components/schemas/SpeakerResource"
# END TALKS
# WORKSHOPS
WorkshopResource:
type: object
required:
- event
- speakers
- room
- date
properties:
event:
$ref: "#/components/schemas/EventResource"
speakers:
type: array
items:
$ref: "#/components/schemas/SpeakerResource"
room:
type: string
example: Wellington or Peralta
date:
$ref: "#/components/schemas/DateResource"
# END WORKSHOPS
# PRIZE
PrizeResource:
type: object
required:
- name
- description
- image
- value
properties:
name:
type: string
example: Minttu
description:
type: string
example: One full bottle of Minttu
image:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
example: "https://www.images.com/iron_man"
value:
type: number
example: 199.99
# END PRIZE
# SPONSORS
SponsorsResource:
type: array
items:
type: object
required:
- category
- sponsors
properties:
category:
type: string
pattern: "stand | stand-vip | oro | diamante"
example: diamante
sponsors:
type: array
items:
$ref: "#/components/schemas/SponsorResource"
SponsorResource:
type: object
required:
- name
- logo
- url
properties:
name:
type: string
example: Avengers Endgame
logo:
type: object
required:
- image
- url
properties:
source:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
example: "https://www.images.com/iron_man"
url:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
example: "https://www.organization.com/"
# END SPONSORS
AttendanceResource:
type: object
required:
- session_id
- ticket_id
- ticket_signature
- signature
- time_stamp
properties:
session_id:
type: integer
example: 42
ticket_id:
type: integer
example: 75
ticket_signature:
type: string
example: KFSDHJF8232L
signature:
type: string
example: RE34TGFDS
time_stamp:
type: integer
example: 234213414123
LocationResource:
type: object
required:
- days
- rooms
- ticket_id
properties:
days:
type: array
items:
type: integer
example: 1
rooms:
type: array
items:
type: string
example: "Salon de Actos"
ticket_id:
type: integer
example: 75
OrganizerResource:
required:
- name
- description
- email
- role
- image
properties:
name:
type: string
example: Iron man
description:
type: string
example: Best superhero ever
email:
type: string
format: email
example: [email protected]
role:
type: string
example: It is the boss
image:
type: string
pattern: http[s]?:\/\/(?:[a-zA-Z]|[0-9]|[\/.?&+!*=\-])+(?![^,!;:\s)])
format: url
example: "https://www.image.com/"
PostSuccessResource:
type: object
required:
- code
- message
- message_abbr
properties:
code:
type: integer
example: 12
message:
type: string
example: "Ticket creado correctamente"
message_abbr:
type: string
example: "ticket_post_success // See messages abbreviations"