Commit bcef1dda authored by Bergamote Orange's avatar Bergamote Orange
Browse files

doc: interface contract v2 spec

parent b72e8ddc
openapi: 3.0.3
info:
title: Tous AntiCovid Cluster Exposure Verification (Cléa)
description: "#TOUSANTICOVID, Cléa API v2"
contact:
email: stopcovid@inria.fr
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0
servers:
- url: http://localhost:8080
description: Inferred Url
tags:
- name: clea
description: Clea API
paths:
"/api/v2/wreport":
post:
tags:
- clea
summary: Upload locations history
description: |
Upload a list of {encryptedLocationSpecificPart, scanTime} tuples where :
* **encryptedLocationSpecificPart**: Encrypted location specific part encoded in Base64
* **scanTime**: ISO 8601 timestamp when a user terminal scans a given QR code
operationId: reportUsingPOST
requestBody:
content:
application/json:
schema:
"$ref": "#/components/schemas/ReportRequest"
responses:
"200":
description: Successful Operation
content:
application/json:
schema:
"$ref": "#/components/schemas/ReportResponse"
examples:
example-0:
value: |-
{
"success": "true",
"message": "2 qr processed, 0 rejected"
}
"400":
description: Bad Request
content:
application/json:
schema:
"$ref": "#/components/schemas/ErrorResponse"
"401":
description: Invalid Authentication
content:
application/json:
schema:
"$ref": "#/components/schemas/ErrorResponse"
"500":
description: Internal Error
content:
application/json:
schema:
"$ref": "#/components/schemas/ErrorResponse"
security:
- Authorization:
- global
"/api/v2/manualreport":
post:
tags:
- clea
summary: Manually upload locations history
description: |
Upload a list of {encryptedLocationSpecificPart, scanTime} tuples where :
* **encryptedLocationSpecificPart**: Encrypted location specific part encoded in Base64
* **scanTime**: ISO 8601 timestamp when a user terminal scans a given QR code
Pivot date for the whole list is automatically set to 1 hour before oldest visit of the list
operationId: manualReportUsingPost
requestBody:
content:
application/json:
schema:
"$ref": "#/components/schemas/ManualReportRequest"
responses:
"200":
description: Successful Operation
content:
application/json:
schema:
"$ref": "#/components/schemas/ReportResponse"
examples:
example-0:
value: |-
{
"success": "true",
"message": "2 qr processed, 0 rejected"
}
"400":
description: Bad Request
content:
application/json:
schema:
"$ref": "#/components/schemas/ErrorResponse"
"401":
description: Invalid Authentication
content:
application/json:
schema:
"$ref": "#/components/schemas/ErrorResponse"
"500":
description: Internal Error
content:
application/json:
schema:
"$ref": "#/components/schemas/ErrorResponse"
security:
- Authorization:
- global
components:
schemas:
ReportRequest:
title: ReportRequest
required:
- visits
- pivotDate
type: object
properties:
pivotDate:
type: integer
format: int64
visits:
type: array
items:
"$ref": "#/components/schemas/Visit"
ManualReportRequest:
title: ManualReportRequest
required:
- visits
type: object
properties:
visits:
type: array
items:
"$ref": "#/components/schemas/Visit"
ReportResponse:
title: ReportResponse
type: object
properties:
message:
type: string
success:
type: boolean
ErrorResponse:
title: ErrorResponse
type: object
properties:
httpStatus:
type: string
timestamp:
type: string
message:
type: string
validationErrors:
type: array
items:
"$ref": "#/components/schemas/ValidationError"
Visit:
title: Visit
required:
- encryptedLocationSpecificPart
- scanTime
type: object
properties:
encryptedLocationSpecificPart:
type: string
scanTime:
type: integer
format: int64
ValidationError:
title: Validation error
type: object
properties:
object:
type: string
field:
type: string
rejectedValue:
type: object
message:
type: string
securitySchemes:
Authorization:
type: apiKey
name: Authorization
in: header
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment