API Pattern: Upload
Token API V1 (deprecated) and V2: Upload single PCR- or LFD test result (once)
- Test result upload (V1 - deprecated - will be only supported during a transition period)
POST https://<FQDN>/upload/virology-test/<SOURCE>-result-tokengen- Can only be used to upload PCR test results (or LFD-like test results to be treated as PCR test results - depending on the current policy)
- Test result upload (V2)
POST https://<FQDN>/upload/virology-test/v2/<SOURCE>-result-tokengen- Can be used to upload LFD-like and PCR-like test results
- Test token status (V2)
POST https://<FQDN>/upload/virology-test/v2/<SOURCE>-result-tokenstatus
- Valid SOURCE values:
eng: BSAwls: PHW
- Authorization required and signatures NOT provided - see API security
This API provides upload endpoints for UK wide integration of virology test result delivery to the NHS COVID-19 App System.
The endpoint URL has path elements specific to the external system using it (SOURCE). All endpoints behave identical, the source path element is required to setup IP whitelisting rules.
Note: The Token API and the Test Lab API are conceptually the same endpoint but should not be called as part of the same flow (mutually exclusive for the same test result). The key difference is that the Test Lab API expects a ctaToken as input (generated previously by our system) and the Token API creates and returns a ctaToken.
See also Test Lab API for valid testResult codes.
POST https://<FQDN>/upload/virology-test/eng-result-tokengen
{
"testEndDate": "2020-04-23T00:00:00Z",
"testResult": "NEGATIVE"
}{
"ctaToken": "1234abcd"
}POST https://<FQDN>/upload/virology-test/v2/wls-result-tokengen
{
"testEndDate": "2020-05-23T00:00:00Z",
"testResult": "POSITIVE",
"testKit": "RAPID_RESULT"
}{
"ctaToken": "1234abcd"
}POST https://<FQDN>/upload/virology-test/v2/wls-result-tokenstatus
{
"ctaToken": "1234abcd"
}{
"tokenStatus": "consumable|other"
}V1 and V2 APIs
testEndDateISO8601 format in UTC. Example:2020-04-23T00:00:00Z. Time is set to0to obfuscate test result relation to personal datatestResultone of the followingPOSITIVENEGATIVEVOIDINDETERMINATEPLOD(testKit must beLAB_RESULT)
- Please note:
INDETERMINATEandVOIDare both treated asVOIDby the mobile application - the behaviour could change in the future
V1 API
testKitfield MUST NOT be present- Test result will be treated as
LAB_RESULT
- Test result will be treated as
V2 API
testKitone of the followingLAB_RESULTRAPID_RESULT(only positive test results are supported)RAPID_SELF_REPORTED(only positive test results are supported)
200 OKok422 Unprocessable Entityinvalid json request body500 Internal Server Errorinternal server error503 Service Unavailablemaintenance mode
When the service is in maintenance mode, all services will return 503 Service Unavailable. Maintenance mode is used when performing operations like backup and restore of the service data.
- Note that distribution to mobile clients depends on system latency and mobile systems background polling scheduler. So it might take between 6h to 24h until uploaded test results are finally delivered to the mobile app.