-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.json
741 lines (741 loc) · 22.3 KB
/
swagger.json
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
{
"swagger" : "2.0",
"info" : {
"description" : "The API for Zerobase's Smart Tracing system.",
"version" : "1.0.0",
"title" : "Zerobase Smart Tracing",
"contact" : {
"email" : "[email protected]"
},
"license" : {
"name" : "Apache 2.0",
"url" : "https://github.com/zerobase-io/smart-tracing-api/blob/master/LICENSE"
}
},
"tags" : [ {
"name" : "organization",
"description" : "All operations pertaining to Organizations."
}, {
"name" : "site",
"description" : "All operations pertaining to Sites."
}, {
"name" : "scannable",
"description" : "All operations pertaining to Scannables."
}, {
"name" : "device",
"description" : "All operations pertaining to Devices."
}, {
"name" : "user",
"description" : "All operations pertaining to Users."
}, {
"name" : "check-in",
"description" : "All operations pertaining to CheckIns"
}, {
"name" : "models",
"description" : "A set of endpoints that return dynamic data about models, such as valid values for an enum."
} ],
"schemes" : [ "https" ],
"paths" : {
"/organizations" : {
"post" : {
"tags" : [ "organization" ],
"summary" : "Creates a new Organization from the request body.",
"description" : "",
"operationId" : "createOrg",
"produces" : [ "application/json" ],
"parameters" : [ {
"in" : "body",
"name" : "organization",
"description" : "The new Organization to be created.",
"required" : true,
"schema" : {
"$ref" : "#/definitions/Organization"
}
} ],
"responses" : {
"201" : {
"description" : "Successful operation.",
"schema" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "string",
"description" : "The ID of the new Organization."
}
}
}
}
}
}
},
"/organizations/{organizationId}/multiple-sites-setting" : {
"put" : {
"tags" : [ "organization" ],
"summary" : "Updated the hasMultipleSites property of the specified Organization.",
"description" : "",
"operationId" : "updateOrgMultiSiteSetting",
"consumes" : [ "application/json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"description" : "The Organization whose hasMultipleSites setting should be updated.",
"required" : true,
"type" : "string"
}, {
"name" : "hasMultipleSites",
"in" : "body",
"description" : "The new value for hasMultipleSites.",
"required" : true,
"schema" : {
"type" : "boolean"
}
} ],
"responses" : {
"204" : {
"description" : "Successful operation."
}
}
}
},
"/organizations/{organizationId}/sites" : {
"post" : {
"tags" : [ "organization" ],
"summary" : "Creates a new Site under the specified Organization.",
"description" : "",
"operationId" : "createSite",
"consumes" : [ "application/json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"description" : "The Organization to which the new Site should be added.",
"required" : true,
"type" : "string"
}, {
"name" : "site",
"in" : "body",
"description" : "The new Site to be created.",
"required" : true,
"schema" : {
"$ref" : "#/definitions/Site"
}
} ],
"responses" : {
"201" : {
"description" : "Successful operation.",
"schema" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "string",
"description" : "The ID of the new Site."
}
}
}
},
"404" : {
"description" : "The specified Organization doesn't exist."
}
}
},
"get" : {
"tags" : [ "organization", "site" ],
"summary" : "Returns the sites for the specified Organization.",
"description" : "",
"operationId" : "getSites",
"produces" : [ "application/json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"description" : "The Organization whose sites should be returned.",
"required" : true,
"type" : "string"
} ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"name" : {
"type" : "string",
"description" : "The name of the site."
},
"id" : {
"type" : "string",
"description" : "The ID of the site."
}
}
}
}
},
"404" : {
"description" : "The specified Organization doesn't exist."
}
}
}
},
"/organizations/{organizationId}/sites/{siteId}/scannables" : {
"post" : {
"tags" : [ "organization", "site", "scannable" ],
"summary" : "Creates a new Scannable for the specified Site.",
"description" : "",
"operationId" : "getScannables",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ],
"parameters" : [ {
"name" : "organizationId",
"in" : "path",
"description" : "The Organization that owns the specified Site.",
"required" : true,
"type" : "string"
}, {
"name" : "siteId",
"in" : "path",
"description" : "The Site to which the new Scannable should be added.",
"required" : true,
"type" : "string"
}, {
"name" : "scannable",
"in" : "body",
"description" : "The new Scannable to be created.",
"required" : true,
"schema" : {
"$ref" : "#/definitions/Scannable"
}
} ],
"responses" : {
"201" : {
"description" : "Successful operation.",
"schema" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "string",
"description" : "The ID of the new Scannable."
}
}
}
},
"404" : {
"description" : "The specified Organization or Site doesn't exist."
}
}
}
},
"/devices" : {
"post" : {
"tags" : [ "device" ],
"summary" : "Creates a new Device.",
"description" : "",
"operationId" : "createDeviceWithoutUser",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ],
"parameters" : [ {
"name" : "device",
"in" : "body",
"description" : "The new Device to be created.",
"required" : true,
"schema" : {
"$ref" : "#/definitions/Device"
}
} ],
"responses" : {
"201" : {
"description" : "Successful operation.",
"schema" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "string",
"description" : "The ID of the new User."
}
}
}
}
}
}
},
"/users" : {
"post" : {
"tags" : [ "user" ],
"summary" : "Creates a new User.",
"description" : "",
"operationId" : "createUser",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ],
"parameters" : [ {
"name" : "user",
"in" : "body",
"description" : "The new User to be created.",
"required" : true,
"schema" : {
"$ref" : "#/definitions/User"
}
} ],
"responses" : {
"201" : {
"description" : "Successful operation.",
"schema" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "string",
"description" : "The ID of the new User."
}
}
}
}
}
}
},
"/users/{userId}/devices" : {
"post" : {
"tags" : [ "user", "device" ],
"summary" : "Creates a new Device for an existing User",
"description" : "",
"operationId" : "createDeviceWithUser",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ],
"parameters" : [ {
"name" : "userId",
"in" : "path",
"description" : "The ID of the User that the new Device will belong to.",
"required" : true,
"type" : "string"
}, {
"name" : "device",
"in" : "body",
"description" : "The Device associated with the user based on user id",
"required" : true,
"schema" : {
"$ref" : "#/definitions/Device"
}
} ],
"responses" : {
"201" : {
"description" : "Successful operation.",
"schema" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "string",
"description" : "The ID of the new Device."
}
}
}
},
"404" : {
"description" : "User doesn't exist"
}
}
}
},
"/devices/{deviceId}/check-ins" : {
"post" : {
"tags" : [ "device", "check-in" ],
"summary" : "Creates a new CheckIn for the specified Device.",
"description" : "",
"operationId" : "createCheckIn",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ],
"parameters" : [ {
"name" : "deviceId",
"in" : "path",
"description" : "The ID of the Device that the new CheckIn will belong to.",
"required" : true,
"type" : "string"
}, {
"name" : "checkIn",
"in" : "body",
"description" : "The new CheckIn to be created.",
"required" : true,
"schema" : {
"$ref" : "#/definitions/CheckIn"
}
} ],
"responses" : {
"201" : {
"description" : "Successful operation.",
"schema" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "string",
"description" : "The ID of the new CheckIn."
}
}
}
},
"404" : {
"description" : "Device doesn't exist."
}
}
}
},
"/devices/{deviceId}/check-ins/{checkInId}/location" : {
"put" : {
"tags" : [ "device", "check-in" ],
"summary" : "Updates the location of an existing CheckIn.",
"description" : "",
"operationId" : "updateCheckInLocation",
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ],
"parameters" : [ {
"name" : "deviceId",
"in" : "path",
"description" : "The ID of the Device that the specified CheckIn belongs to.",
"required" : true,
"type" : "string"
}, {
"name" : "checkInId",
"in" : "path",
"description" : "The ID of the CheckIn whose location should be updated.",
"required" : true,
"type" : "string"
}, {
"name" : "location",
"in" : "body",
"description" : "The new location for the specified CheckIn.",
"required" : true,
"schema" : {
"$ref" : "#/definitions/Location"
}
} ],
"responses" : {
"204" : {
"description" : "Successful operation."
},
"404" : {
"description" : "Device or CheckIn doesn't exist."
}
}
}
},
"/users/{userId}/summary" : {
"get" : {
"tags" : [ "user" ],
"summary" : "Dumps the information we have on a User for GDPR compliance reasons.",
"description" : "",
"operationId" : "userSummary",
"produces" : [ "application/json" ],
"parameters" : [ {
"name" : "userId",
"in" : "path",
"description" : "The ID of the User whose information should be returned.",
"required" : true,
"type" : "string"
} ],
"responses" : {
"200" : {
"description" : "Successful operation."
},
"404" : {
"description" : "User doesn't exist."
}
}
}
},
"/users/{userId}" : {
"delete" : {
"tags" : [ "user" ],
"summary" : "Deletes the specified User.",
"description" : "",
"operationId" : "deleteUser",
"parameters" : [ {
"name" : "userId",
"in" : "path",
"description" : "The ID of the User to be deleted.",
"required" : true,
"type" : "string"
} ],
"responses" : {
"202" : {
"description" : "Successful operation."
},
"404" : {
"description" : "User doesn't exist."
}
}
}
},
"/models/site-types" : {
"get" : {
"tags" : [ "models" ],
"summary" : "Returns the valid combinations for Site.type in the form of an object whose properties are the categories and whose values are the appropriate subcategories for the parent category.",
"description" : "",
"operationId" : "getSiteTypes",
"responses" : {
"200" : {
"description" : "Successful operation.",
"schema" : {
"type" : "object",
"properties" : {
"category" : {
"type" : "object",
"additionalProperties" : {
"type" : "array",
"items" : {
"type" : "string"
}
}
}
},
"example" : {
"HEALTH" : [ "DOCTOR_OFFICE", "HOSPITAL", "TESTING_CENTER" ],
"COMMUNITY_TOUCHPOINT" : [ "CHURCH", "POST_OFFICE", "MARKET" ]
}
}
}
}
}
},
"/models/scannable-types" : {
"get" : {
"tags" : [ "models" ],
"summary" : "Returns the valid values for Scannable.type in the form of an array.",
"description" : "",
"operationId" : "getScannableTypes",
"responses" : {
"200" : {
"description" : "Successful operation.",
"schema" : {
"type" : "array",
"items" : {
"type" : "string",
"description" : "Valid values for Scannable.type. Only QR_CODE at the moment, but more will likely be added."
},
"example" : [ "QR_CODE", "BLE", "NFC" ]
}
}
}
}
}
},
"definitions" : {
"Address" : {
"type" : "object",
"properties" : {
"premise" : {
"type" : "string",
"description" : "The portion of an address that represents the location on a given thoroughfare.",
"example" : "100"
},
"thoroughfare" : {
"type" : "string",
"description" : "The name of the street/road that the premise value is on",
"example" : "Lafeyette Blvd"
},
"locality" : {
"type" : "string",
"description" : "The name of the town, city, etc",
"example" : "Chicago"
},
"administrativeArea" : {
"type" : "string",
"description" : "The name of the state, province, etc",
"example" : "Quebec"
},
"postalCode" : {
"type" : "string",
"example" : "90210"
},
"country" : {
"type" : "string",
"description" : "3-letter ISO country code",
"example" : "USA"
}
}
},
"Organization" : {
"type" : "object",
"description" : "An incorporated entity which owns one or more sites.",
"properties" : {
"id" : {
"type" : "string"
},
"name" : {
"type" : "string",
"description" : "The name of the organization.",
"example" : "Zerobase Inc."
},
"contactInfo" : {
"$ref" : "#/definitions/ContactInfo"
},
"address" : {
"$ref" : "#/definitions/Address",
"description" : "The primary address for the whole organization, such as the street address of their headquarters or the address of a P.O. box."
},
"hasMultipleSites" : {
"type" : "boolean",
"default" : true,
"description" : "True if the organization has multiple testing sites, false otherwise."
},
"hasTestingFacilities" : {
"type" : "boolean",
"default" : false,
"description" : "True if the organization represents a party who we have confirmed is able to perform SARS-COV-2 testing, and should thus have the right to confirm test results."
}
},
"required" : [ "name", "contactInfo", "address" ]
},
"Site" : {
"type" : "object",
"description" : "A singular location or building.",
"properties" : {
"id" : {
"type" : "string"
},
"name" : {
"type" : "string",
"description" : "The name of the site.",
"example" : "John & Jane's Family Pharmacy"
},
"active" : {
"type" : "boolean",
"default" : true
},
"location" : {
"$ref" : "#/definitions/Location"
},
"isTesting" : {
"type" : "boolean",
"default" : false,
"description" : "True if the site is a facility (meaning they are verified as being able to run tests for SARS-COV-2)."
},
"siteManagerContactInfo" : {
"$ref" : "#/definitions/ContactInfo"
},
"category" : {
"type" : "string",
"description" : "The main category of the site",
"enum" : [ "BUSINESS", "FINANCIAL", "HEALTH" ]
},
"subcategory" : {
"type" : "string",
"description" : "The sub-category of the site, must be a valid subcategory of the main category",
"example" : "DOCTORS_OFFICE"
}
},
"required" : [ "cateogry", "subcategory" ]
},
"Scannable" : {
"type" : "object",
"description" : "Something which a user can scan, be it a QR code, a BLE beacon or an NFC tag.",
"properties" : {
"id" : {
"type" : "string"
},
"type" : {
"type" : "string",
"enum" : [ "QR_CODE" ]
},
"singleUse" : {
"type" : "boolean",
"default" : false
}
},
"required" : [ "type" ]
},
"Device" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "string"
},
"fingerprint" : {
"type" : "string"
}
},
"required" : [ "fingerprint" ]
},
"User" : {
"type" : "object",
"properties" : {
"name" : {
"type" : "string"
},
"contact" : {
"type" : "object",
"properties" : {
"phone" : {
"type" : "string",
"description" : "The user's phone number for sending SMS notifications."
},
"email" : {
"type" : "string",
"description" : "The user's email address for sending email notifications."
}
}
},
"deviceId" : {
"type" : "string",
"description" : "The ID of the device that belongs to this user."
}
},
"required" : [ "deviceId" ]
},
"CheckIn" : {
"type" : "object",
"description" : "An object that represents an instance of a user checking in to a Scannable.",
"properties" : {
"scannedId" : {
"type" : "string",
"description" : "The ID of the Scannable or Device that was scanned."
},
"type" : {
"type" : "string",
"enum" : [ "DEVICE_TO_DEVICE", "DEVICE_TO_SCANNABLE" ]
},
"location" : {
"$ref" : "#/definitions/Location"
}
},
"required" : [ "scannedId", "type" ]
},
"ContactInfo" : {
"type" : "object",
"description" : "Contact information for an Organization/Site or individual who has the right to represent one of the same.",
"properties" : {
"id" : {
"type" : "string"
},
"phone" : {
"type" : "string",
"format" : "E.164",
"description" : "The primary phone number for the organization.",
"example" : "+15551234567"
},
"email" : {
"type" : "string",
"description" : "The primary email for the organization.",
"example" : "[email protected]"
},
"contactName" : {
"type" : "string",
"description" : "The name of the individual who is our primary point of contact.",
"example" : "John Doe"
}
},
"required" : [ "phone", "email", "contactName" ]
},
"Location" : {
"type" : "object",
"description" : "A location comprised of a latitude and longitude.",
"properties" : {
"lat" : {
"type" : "number",
"example" : 4.5454
},
"long" : {
"type" : "number",
"example" : -12.34567
}
},
"required" : [ "lat", "long" ]
}
},
"host" : "virtserver.swaggerhub.com",
"basePath" : "/zerobase/zerobase-api/1.0.0"
}