This repository has been archived by the owner on Apr 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
/
openapi.yaml
1625 lines (1624 loc) · 53.7 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
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.1
info:
title: Respa
description: The Respa API provides categorized data on resources available for reservation within a city or metropolitan area
and enables the reservation of these resources. The API provides data in the JSON format, in a RESTful fashion.
version: 1.6.2
servers:
- url: https://api.hel.fi/respa/v1
- url: https://respa.koe.hel.ninja/v1
tags:
- name: resource
description: Look for available resources
- name: reservation
description: Make or change your reservations
- name: unit
description: Places where resources are located
- name: equipment
description: Equipment available for use in the resources
- name: filter
description: Properties you can use in filtering resources
- name: search
description: Typeahead suggestions for objects
paths:
/search/:
get:
tags:
- search
description: |-
Get typeahead suggestions for objects based on an arbitrary user input (the `input` query parameter).
Currently supported are "resource" and "unit".
parameters:
- name: input
in: query
description: Query search parameter
required: true
schema:
type: string
- name: full
in: query
description: Return all properties with the objects
schema:
type: boolean
- name: types
in: query
description: Return only objects of the specified types
schema:
type: string
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
unit:
type: array
items:
$ref: '#/components/schemas/unit'
resource:
type: array
items:
$ref: '#/components/schemas/resource'
/unit/:
get:
tags:
- unit
description: The unit endpoint returns units (libraries, youth centers etc.) listed in the reservation system. The optional
parameter **page** allows specifying page number and **page_size** allows specifying more than the default 20 units per page.
parameters:
- name: resource_group
in: query
description: Only return units whose resources belong to the speficied resource
group(s). Accepts multiple comma-separated values.
schema:
type: string
- name: page
in: query
description: Result page number
schema:
type: integer
- name: page_size
in: query
description: Number of units per page
schema:
type: integer
- name: unit_has_resource
in: query
description: Only return units that either have or do not have related resources,
based on the boolean value given.
schema:
type: boolean
- name: include
in: query
description: Include extra data to queryset. Currently accepts value `accessibility_summaries`.
schema:
type: string
example: accessibility_summaries
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
next:
type: string
description: URL for the next page
prev:
type: string
description: URL for the previous page
count:
type: integer
description: The total number of results
results:
type: array
items:
$ref: '#/components/schemas/unit'
/unit/{id}/:
get:
tags:
- unit
description: The unit endpoint returns units (libraries, youth
centers etc.) listed in the reservation system.
parameters:
- name: id
in: path
description: Unique identifier for the unit in the service registry.
required: true
schema:
type: string
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/unit'
/purpose/:
get:
tags:
- filter
description: The purpose endpoint returns the possible resource usage purposes registered in the system.
The optional parameter **page** allows specifying page number and **page_size** allows specifying more than the default
50 purposes per page.
parameters:
- name: page
in: query
description: Result page number
schema:
type: integer
- name: page_size
in: query
description: Number of purposes per page
schema:
type: integer
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
next:
type: string
description: URL for the next page
prev:
type: string
description: URL for the previous page
count:
type: integer
description: The total number of results
results:
type: array
items:
$ref: '#/components/schemas/purpose'
/purpose/{id}/:
get:
tags:
- filter
description: The purpose endpoint returns the possible resource usage purposes
registered in the system.
parameters:
- name: id
in: path
description: Unique identifier of the usage purpose.
required: true
schema:
type: string
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/purpose'
/type/:
get:
tags:
- filter
description: The type endpoint returns the possible resource types registered in the system. The optional parameter **page**
allows specifying page number and **page_size** allows specifying more than the default 20 units per page.
parameters:
- name: resource_group
in: query
description: Only return types for which there are resources that belong to
the speficied resource group(s). Accepts multiple comma-separated values.
schema:
type: string
- name: page
in: query
description: Result page number
schema:
type: integer
- name: page_size
in: query
description: Number of types per page
schema:
type: integer
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
next:
type: string
description: URL for the next page
prev:
type: string
description: URL for the previous page
count:
type: integer
description: The total number of results
results:
type: array
items:
$ref: '#/components/schemas/type'
/type/{id}/:
get:
tags:
- filter
description: The type endpoint returns the possible resource types registered
in the system.
parameters:
- name: id
in: path
description: Unique identifier of the resource type.
required: true
schema:
type: string
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/type'
/equipment/:
get:
tags:
- equipment
description: The equipment endpoint returns the pieces of equipment of the resources. The optional parameter **page** allows
specifying page number and **page_size** allows specifying more than the default 20 pieces of equipment per page.
parameters:
- name: resource_group
in: query
description: Only return pieces of equipment that belong to the speficied
resource group(s). Accepts multiple comma-separated values. Use equipment ID.
schema:
type: string
- name: page
in: query
description: Result page number
schema:
type: integer
- name: page_size
in: query
description: Number of pieces of equipment per page
schema:
type: integer
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
next:
type: string
description: URL for the next page
prev:
type: string
description: URL for the previous page
count:
type: integer
description: The total number of results
results:
type: array
items:
$ref: '#/components/schemas/equipment'
/equipment/{id}/:
get:
tags:
- equipment
description: The equipment endpoint returns the pieces of equipment of the resources.
parameters:
- name: id
in: path
description: Unique identifier for the piece of equipment.
required: true
schema:
type: string
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/equipment'
/equipmentcategory/:
get:
tags:
- equipment
description: The equipment category endpoint returns the possible categories for the pieces of equipment. The optional parameter
**page** allows specifying page number and **page_size** allows specifying more than the default 20 equipment categories per page.
parameters:
- name: page
in: query
description: Result page number
schema:
type: integer
- name: page_size
in: query
description: Number of equipment categories per page
schema:
type: integer
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
next:
type: string
description: URL for the next page
prev:
type: string
description: URL for the previous page
count:
type: integer
description: The total number of results
results:
type: array
items:
$ref: '#/components/schemas/equipmentcategory'
/equipmentcategory/{id}/:
get:
tags:
- equipment
description: The equipment category endpoint returns the possible categories
for the pieces of equipment.
parameters:
- name: id
in: path
description: Unique identifier for the equipment category in the service registry.
required: true
schema:
type: string
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/equipmentcategory'
/resource/:
get:
tags:
- resource
description: The resource endpoint returns resources (e.g. meeting rooms) listed in the reservation system,
allowing queries based on resource purpose, type, name and availability. Availability can be specified for a desired
duration in a desired time interval. This allows fetching only the resources that match a particular need at a particular time.
The optional **page** parameter allows specifying page number and **page_size** allows specifying more than the default 20 units per page.
parameters:
- name: purpose
in: query
description: Only return resources that have the specified purpose(s)
schema:
type: string
example: meetings-and-working
- name: type
in: query
description: Only return resources of the specified type(s). Accepts multiple
comma-separated values.
schema:
type: string
example: av5k4tflpjvq
- name: search
in: query
description: Only return resources matching the specified string. Queries the resource name, description and unit name fields.
schema:
type: string
- name: start
in: query
description: Use together with `end`. Only return resources that are free
within the specified interval. Accepts ISO 8601 format.
schema:
type: string
format: date-time
- name: end
in: query
description: Use together with `start`. Only return resources that are free
within the specified interval. Accepts ISO 8601 format.
schema:
type: string
format: date-time
- name: duration
in: query
description: Use together with `start` and `end`. Only return resources that
are free for a consecutive period of `duration` minutes within the specified
interval.
schema:
type: number
- name: during_closing
in: query
description: Use together with `start` and `end`. Include resources that are
free but closed within the specified interval.
schema:
type: boolean
- name: people
in: query
description: Only return resources with greater or equal capacity
schema:
type: number
example: 2
- name: equipment
in: query
description: Only return resources that contain the specified piece(s) of
equipment. Accepts multiple comma-separated values of equipment ID.
schema:
type: string
- name: resource_group
in: query
description: Only return resources that belong to the speficied resource group(s).
Accepts multiple comma-separated values.
schema:
type: string
- name: unit
in: query
description: Only return resources that belong to the specified unit.
schema:
type: string
example: tprek:51342
- name: need_manual_confirmation
in: query
description: Only return resources that need or do not need manual confirmation,
based on the boolean value.
schema:
type: boolean
- name: is_favorite
in: query
description: Only return resources that are or are not favorited by authenticated
user, based on the boolean value.
schema:
type: boolean
- name: available_between
in: query
description: Only return resources that are open and free on the given datetime
range. Expects two comma-separated datetimes as start and end time. Accepts
also a third comma-separated value (period length in minutes), which can
be used to determine a minimum free slot length that must exists in the
main time range.
schema:
type: string
- name: page
in: query
description: Result page number
schema:
type: integer
example: 1
- name: page_size
in: query
description: Number of resources per page
schema:
type: integer
example: 10
- name: lat
in: query
description: Use together with `lon` and `distance`. Specifies latitude to
return only resources that are within the given `distance`.
schema:
type: number
example: 60.1695096
- name: lon
in: query
description: Use together with `lat` and `distance`. Specifies longitude to
return only resources that are within the given `distance`.
schema:
type: number
example: 24.9405559
- name: distance
in: query
description: Use together with `lat` and `long`. Returns only resources that
are within the given `distance` of the point which is calculated from `lat`
and `lon`.
schema:
type: number
example: 10000.2
- name: free_of_charge
in: query
description: If given boolean is `true`, returns only resources that have
their `min_price` value of `0` or `None`. If given boolean is `false`,
returns resources that have their `min_price` greater than 0.
schema:
type: boolean
- name: municipality
in: query
description: Only return resources that belong to units that are located in
the given municipality.
schema:
type: string
example: helsinki
- name: order_by
in: query
description: Order queryset by given resource fields, accepted values are
`resource_name_fi`, `resource_name_en`, `resource_name_sv`, `unit_name_fi`,
`unit_name_en`, `unit_name_sv`, `type`, `people_capacity`, `accessibility`. Prefix parameter
value with `-` to get reverse ordering.
schema:
type: string
example: resource_name_fi
- name: accessibility_viewpoint
in: query
description: Use together with `order_by` `accessibility`. Determines the viewpoint for accessibility ordering using the viewpoint ID.
schema:
type: number
example: 11
- name: include
in: query
description: Include extra data to queryset. Currently accepts values `unit_detail`, `accessibility_summaries`.
schema:
type: string
example: unit_detail
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
next:
type: string
description: URL for the next page
prev:
type: string
description: URL for the previous page
count:
type: integer
description: The total number of results
results:
type: array
items:
allOf:
- $ref: '#/components/schemas/resource'
- type: object
properties:
products:
type: array
items:
$ref: '#/components/schemas/product'
/resource/{id}/:
get:
tags:
- resource
description: The resource endpoint returns resources (meeting rooms, workstations,
reservable spaces etc.) listed in the reservation system.
parameters:
- name: id
in: path
description: Unique identifier for the resource in the reservation system.
required: true
schema:
type: string
- name: start
in: query
description: Use together with `end`. Specifies starting time for reporting
opening hours, availability and reservations.
schema:
type: string
format: date-time
- name: end
in: query
description: Use together with `start`. Specifies ending time for reporting
opening hours, availability and reservations.
schema:
type: string
format: date-time
- name: duration
in: query
description: Use together with `start` and `end`. Specifies minimum free period
duration for resource availability.
schema:
type: number
responses:
200:
description: Successful response
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/resource'
- type: object
properties:
products:
type: array
items:
$ref: '#/components/schemas/product'
/reservation/:
get:
tags:
- reservation
description: The reservation endpoint returns reservations listed in the reservation system. The optional parameter **page**
allows specifying page number and **page_size** allows specifying more than the default 20 units per page.
parameters:
- name: page
in: query
description: Result page number
schema:
type: integer
- name: page_size
in: query
description: Number of reservations per page
schema:
type: integer
- name: resource
in: query
description: Resource id, for filtering reservations by resource. Accepts multiple comma-separated values.
schema:
type: string
- name: all
in: query
description: Display also past reservations. Default to false.
schema:
type: boolean
- name: need_manual_confirmation
in: query
description: Filter reservations based on their need of a manual confirmation
from unit personnel.
schema:
type: boolean
- name: reserver_info_search
in: query
description: Only return reservations matching the specified string. Queries the
reserver's name, email and phone number.
schema:
type: string
- name: state
in: query
description: 'Display only reservation(s) in given state(s). Possible values:
cancelled, confirmed, denied and requested.'
schema:
type: string
- name: can_approve
in: query
description: Display reservations that the request user has the right to approve.
schema:
type: boolean
- name: resource_group
in: query
description: Only return reservations for resources that belong to the speficied
resource group(s). Accepts multiple comma-separated values.
schema:
type: string
- name: event_subject
in: query
description: Only return reservations that has given parameter in the event
subject.
schema:
type: string
- name: host_name
in: query
description: Only return reservations that has given parameter in the host
name field.
schema:
type: string
- name: reserver_name
in: query
description: Only return reservations that has given parameter in the reserver
name field.
schema:
type: string
- name: resource_name
in: query
description: Only return reservations that has given parameter in the resource
name field.
schema:
type: string
- name: unit
in: query
description: Only return reservations for resources that belong to the specified
unit.
schema:
type: string
- name: start
in: query
description: The starting time of the reservation in ISO 8601 format.
schema:
type: string
- name: end
in: query
description: The ending time of the reservation in ISO 8601 format.
schema:
type: string
- name: has_catering_order
in: query
description: Return only reservations which either have or do not have related
catering orders based on the boolean value.
schema:
type: boolean
- name: is_favorite_resource
in: query
description: Return only reservations that are related to resource that either
is or is not favorited by user, based on the boolean value.
schema:
type: boolean
- name: user
in: query
description: Return only reservations that are related to given user. Expects
to recieve user's UUID.
schema:
type: string
- name: is_own
in: query
description: Return only own reservations
schema:
type: boolean
- name: include
in: query
description: Include extra data to queryset. Currently accepts values `resource_detail` and `order_detail` (available only when the payment support is enabled).
To get more than one extra data entry, use multiple include parameters eg. `?include=resource_detail&include=order_detail`.
schema:
type: string
example: resource_detail
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
properties:
next:
type: string
description: URL for the next page
prev:
type: string
description: URL for the previous page
count:
type: integer
description: The total number of results
results:
type: array
items:
allOf:
- $ref: '#/components/schemas/reservation'
- $ref: '#/components/schemas/order_just_id'
post:
tags:
- reservation
description: The reservation endpoint accepts reservations.
requestBody:
description: The reservation you wish to make
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/reservation'
- $ref: '#/components/schemas/order_creation_request'
required: true
responses:
201:
description: Reservation created
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/reservation'
- $ref: '#/components/schemas/order_creation_response'
400:
description: Bad request
content:
application/json:
schema:
type: object
properties:
non_field_errors:
type: string
description: The reason the reservation was not accepted
/reservation/{id}/:
get:
tags:
- reservation
description: The reservation endpoint returns reservations listed in the reservation
system.
parameters:
- name: id
in: path
description: Unique identifier of the reservation in the reservation system.
required: true
schema:
type: string
responses:
200:
description: Successful response
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/reservation'
- $ref: '#/components/schemas/order_just_id'
put:
tags:
- reservation
description: The reservation endpoint allows editing existing reservations.
parameters:
- name: id
in: path
description: Unique identifier of the reservation in the reservation system.
required: true
schema:
type: string
requestBody:
description: The reservation data you wish to edit
content:
application/json:
schema:
$ref: '#/components/schemas/reservation'
required: true
responses:
200:
description: Successful response
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/reservation'
- $ref: '#/components/schemas/order_just_id'
400:
description: Bad request
content:
application/json:
schema:
type: object
properties:
non_field_errors:
type: string
description: The reason the change was not accepted
patch:
tags:
- reservation
description: The reservation endpoint allows changing state of reservation with a reason message
parameters:
- name: id
in: path
description: Unique identifier of the reservation in the reservation system.
required: true
schema:
type: string
requestBody:
description: The reservation data you wish to edit. State and cancel reason currently allowed with patch.
content:
'application/json':
schema:
properties:
state:
description: New state for the reservation
type: string
cancel_reason:
description: Reason object for reservation cancellation / denial
type: object
$ref: '#/components/schemas/cancel_reason_write'
required:
- status
responses:
200:
description: Successful response
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/reservation'
- $ref: '#/components/schemas/order_just_id'
400:
description: Bad request
content:
application/json:
schema:
type: object
properties:
non_field_errors:
type: string
description: The reason the change was not accepted
delete:
tags:
- reservation
description: The reservation endpoint allows deleting existing reservations.
parameters:
- name: id
in: path
description: Unique identifier of the reservation in the reservation system.
required: true
schema:
type: string
responses:
204:
description: Reservation deleted
content: {}
/order/check_price/:
post:
tags:
- order
description: Check the price of an order (available only when the payment support is enabled)
requestBody:
description: The order data for which one wishes to find out the price
content:
application/json:
schema:
$ref: '#/components/schemas/order_check_price_request'
responses:
200:
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/order_check_price_response'
/cancel_reason_category/:
get:
tags:
- cancel_reason
description: Predefined categories for cancellation reason for reservations. Includes predefined notification messages in all languages.
parameters:
- name: reservation_type
in: query
description: "Filtering parameter for type of reservation for which this cancel reason category is used. Choices: confirmed, requested, own."
schema:
type: string
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/cancel_reason_category'
components:
schemas:
unit:
type: object
properties:
id:
type: string
description: Unique identifier for the unit in the service registry.
opening_hours_today:
type: object
properties: {}
description: ""
created_at:
type: string
description: ""
modified_at:
type: string
description: ""
name:
type: object
properties:
sv:
type: string
description: Swedish name for the unit
fi:
type: string
description: Finnish name for the unit
en:
type: string
description: English name for the unit
description:
type: string
description: ""
time_zone:
type: string
description: tz database name of the time zone used at the unit
street_address: