-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi_final_rest.json
1 lines (1 loc) · 6.85 KB
/
openapi_final_rest.json
1
{"openapi":"3.0.2","info":{"title":"Contact Tracing API","description":"API for asynchronous and synchronous calls from contact tracing clients","version":"0.1.0"},"paths":{"/health":{"get":{"tags":["Mgmt"],"summary":"Health Check","description":"Health check","operationId":"healthcheck","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Health Check Health Get","type":"string"}}}}}}},"/report-interaction":{"post":{"tags":["Async"],"summary":"Queue Interaction Report","description":"Log contact between a user and multiple users","operationId":"queue_interaction_report","parameters":[{"required":true,"schema":{"title":"Authorization","type":"string"},"name":"Authorization","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InteractionReport"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedAsyncTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/report-health":{"post":{"tags":["Async"],"summary":"Queue Health Report","description":"Log health report under the specified user","operationId":"queue_health_report","parameters":[{"required":true,"schema":{"title":"Authorization","type":"string"},"name":"Authorization","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthReport"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedAsyncTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/set-active-user":{"post":{"tags":["Async"],"summary":"Set Active User","description":"Notify the system that a user has logged in for the first time","operationId":"queue_set_active_user","parameters":[{"required":true,"schema":{"title":"Authorization","type":"string"},"name":"Authorization","in":"header"}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedAsyncTask"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/list/users":{"get":{"tags":["Sync"],"summary":"List Users","description":"List the users from a specified school (no PII)","operationId":"list_users","parameters":[{"required":true,"schema":{"title":"Authorization","type":"string"},"name":"Authorization","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListUsersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/get-user-entry":{"get":{"tags":["Sync"],"summary":"Entry Card","description":"Get a user's current health status","operationId":"user_status","parameters":[{"required":true,"schema":{"title":"Authorization","type":"string"},"name":"Authorization","in":"header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdentifiedUserEntryItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CreatedAsyncTask":{"title":"CreatedAsyncTask","required":["task_id"],"type":"object","properties":{"timestamp":{"title":"Timestamp","type":"integer","default":1609388500},"status":{"title":"Status","enum":["MALFORMED","UNEXPECTED","SUCCESS","QUEUED","ACCESS_DENIED"],"type":"string","default":"QUEUED"},"task_id":{"title":"Task Id","type":"string"}},"description":"Created Asynchronous task with service"},"HTTPValidationError":{"title":"HTTPValidationError","type":"object","properties":{"detail":{"title":"Detail","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"HealthReport":{"title":"HealthReport","type":"object","properties":{"timestamp":{"title":"Timestamp","type":"integer","default":1609388500},"num_symptoms":{"title":"Num Symptoms","type":"integer"},"proximity":{"title":"Proximity","type":"boolean"},"test_type":{"title":"Test Type","enum":["positive","negative"],"type":"string"},"commercial_flight":{"title":"Commercial Flight","type":"boolean"}},"description":"Health Report Report"},"IdentifiedUserEntryItem":{"title":"IdentifiedUserEntryItem","required":["entry","reason"],"type":"object","properties":{"name":{"title":"Name","type":"string"},"entry":{"title":"Entry","type":"boolean"},"reason":{"title":"Reason","enum":["health","location"],"type":"string"},"health":{"$ref":"#/components/schemas/UserHealthItem"},"location":{"$ref":"#/components/schemas/UserLocationItem"}},"description":"Status of whether or not a user is permitted to enter the school"},"InteractionReport":{"title":"InteractionReport","required":["targets"],"type":"object","properties":{"targets":{"title":"Targets","type":"array","items":{"type":"string"}}},"description":"Interaction report schema for API validation and documentation"},"ListUsersResponse":{"title":"ListUsersResponse","required":["users"],"type":"object","properties":{"timestamp":{"title":"Timestamp","type":"integer","default":1609388500},"status":{"title":"Status","enum":["MALFORMED","UNEXPECTED","SUCCESS","QUEUED","ACCESS_DENIED"],"type":"string","default":"SUCCESS"},"users":{"title":"Users","type":"array","items":{"$ref":"#/components/schemas/User"}}},"description":"Listing users in the database response"},"User":{"title":"User","required":["email","school"],"type":"object","properties":{"first_name":{"title":"First Name","type":"string"},"last_name":{"title":"Last Name","type":"string"},"email":{"title":"Email","type":"string"},"school":{"title":"School","type":"string"}},"description":"User Schema for API validation and documentation"},"UserHealthItem":{"title":"UserHealthItem","type":"object","properties":{"color":{"title":"Color","enum":["danger","yellow","gray","success"],"type":"string"},"criteria":{"title":"Criteria","type":"array","items":{"type":"string"},"default":[]}},"description":"Entity representing user risk"},"UserLocationItem":{"title":"UserLocationItem","type":"object","properties":{"color":{"title":"Color","enum":["danger","yellow","gray","success"],"type":"string"},"location":{"title":"Location","enum":["campus","remote","quarantined"],"type":"string"}},"description":"Entity representing user location"},"ValidationError":{"title":"ValidationError","required":["loc","msg","type"],"type":"object","properties":{"loc":{"title":"Location","type":"array","items":{"type":"string"}},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}}}}}}