forked from ramnanib2/coepi-backend-aws
-
Notifications
You must be signed in to change notification settings - Fork 14
/
coepi_api_0.5.0.yml
223 lines (200 loc) · 8.16 KB
/
coepi_api_0.5.0.yml
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
openapi: 3.0.3
info:
description: This is the API model for unified contact tracing server that supports
storage and retrieval of reports and keys for various privacy-preserving contact tracing
protocols.
Below protocols are supported,
1. TCN (https://github.com/TCNCoalition/TCN/blob/main/README.md)
Versions, 0.4.0
2. Apple / Google Contact Tracing (https://www.apple.com/covid19/contacttracing)
Versions, 1.2
version: 0.5.0
title: Universal Contact Tracing Server
license:
name: MIT License
url: https://github.com/Co-Epi/data-models/blob/master/LICENSE
paths:
/tcnreport/0.4.0:
post:
summary: Submit symptom or infection report
description: Users submit symptom / infection reports and reveal the secret TCN Key in their application
as bytes in format 'rvk || tck_{j1-1} || le_u16(j1) || le_u16(j2) || memo'. Details of the TCN protocol
can be found here, https://github.com/TCNCoalition/TCN/blob/main/README.md
requestBody:
required: true
content:
text/plain:
schema:
type: string
format: byte
x-amazon-apigateway-integration:
type: aws_proxy
uri: ${lambda_invoke_arn}
httpMethod: POST
responses:
'200':
description: The report was submitted successfully
'400':
description: The report is not encoded in the correct format
'401':
description: The report signature validation has failed
'500':
description: Internal Server Error
get:
summary: Returns a list of reports generated for a given interval number.
description: Interval number is a positive integer that corresponds to a specific fixed time interval and can
be calculated as (unix_epoch_time_seconds / time_interval_seconds).
Current value of time_interval_ms is (6 * 3600) or 6 hours. When not provided, returns the reports
corresponding to the latest interval batch.
parameters:
- in: query
name: intervalNumber
description: Positive integer that corresponds to a specific fixed time interval and can
be calculated as (unix_epoch_time_seconds / time_interval_seconds). When not provided, current
interval number is assumed.
required: false
schema:
type: integer
format: int64
example: 158874736
- in: query
name: intervalLength
description: The interval length in seconds used by the client to calculate intervalNumber.
The server will respond with a 401 if the interval length does not match the expected length.
required: false
schema:
type: integer
format: int64
example: 21600
x-amazon-apigateway-integration:
type: aws_proxy
uri: ${lambda_invoke_arn}
httpMethod: POST
responses:
'200':
description: List of infection/symptom reports generated during the specified intervalNumber
content:
application/json:
schema:
type: array
items:
type: string
format: byte
'400':
description: Request Parameter Invalid
'432':
description: intervalLength is not valid for the specified intervalNumber
'500':
description: Internal Server Error
/diagnosiskeys/1.2:
post:
summary: Submit a list of diagnosis keys with key data and associated ENIntervalNumber.
Duplicate keys are ignored. This prevents a bad actor from posting the same key to the server with a different
ENIntervalNumber. Key data should be base64 encoded.
description: Submit a list of diagnosis keys corresponding for a given period. Diadnosis Keys are Exposure Notification
Keys generated during the 14 day time period before the infection is reported to the server. The current specification
can be found in the Apple/Google protocol definition.
https://covid19-static.cdn-apple.com/applications/covid19/current/static/contact-tracing/pdf/ExposureNotification-CryptographySpecificationv1.2.pdf
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/DiagnosisKey'
minItems: 1
maxItems: 14
uniqueItems: true
x-amazon-apigateway-integration:
type: aws_proxy
uri: ${lambda_invoke_arn}
httpMethod: POST
responses:
'200':
description: Diagnosis Keys uploaded successfully
'400':
description: Request Parameter Invalid. Example, diagnosis key is invalid or ENIntervalNumber is invalid
'500':
description: Internal Server Error
get:
summary: Returns a list of diagnosis keys reported during a given interval number.
description: Interval number is a positive integer that corresponds to a specific fixed time interval and can
be calculated as (unix_epoch_time_seconds / time_interval_seconds).
Current value of time_interval_ms is (6 * 3600) or 6 hours. When not provided, returns the reports
corresponding to the latest interval batch.
parameters:
- in: query
name: intervalNumber
description: Positive integer that corresponds to a specific fixed time interval and can
be calculated as (unix_epoch_time_seconds / time_interval_seconds). When not provided, current
interval number is assumed.
required: false
schema:
type: integer
format: int64
example: 158874736
- in: query
name: intervalLength
description: The interval length in seconds used by the client to calculate intervalNumber.
The server will respond with a 401 if the interval length does not match the expected length.
required: false
schema:
type: integer
format: int64
example: 21600
x-amazon-apigateway-integration:
type: aws_proxy
uri: ${lambda_invoke_arn}
httpMethod: POST
responses:
'200':
description: List of diagnosis keys reported during the specified intervalNumber
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/DiagnosisKey'
'400':
description: Request Parameter Invalid
'432':
description: intervalLengthSeconds is not valid for the specified date
'500':
description: Internal Server Error
components:
schemas:
DiagnosisKey:
description: Diagnosis Key is a daily tracing key that is revealed by the client to the server when a user
wants to report an infection. It consists of the key data and ENIntervalNumber. ENIntervalNumber is the interval
when the diagnosis key was generated on the device
type: object
properties:
keyData:
type: string
format: byte
description: Base64 encoded key data of diagnosis key
minLength: 25
maxLength: 40
rollingStartNumber:
type: integer
format: int64
description: A unique unsigned integer corresponding to a specific interval when the key was generated,
calculated as (Number of Seconds since Epoch) / (Interval Length in seconds). Currently this is 10 minutes
minimum: 0
transmissionRiskLevel:
type: integer
format: int32
description: The risk of transmission associated with the person a key came from
minimum: 0
rollingPeriod:
type: integer
format: int64
description: The length of time that this key is valid in multiples of 10 minutes. Example 144 is equivalent
to 1 day
minimum: 0
example:
keyData: "NGk1dTZoZDsnbHBbXXA5MAo="
rollingStartNumber: 2648203
rollingPeriod: 144
transmissionRiskLevel: 3