Case

Batch upserts cases

Changed on
post/cases/batchUpsert

Request

  • Base URL
    http://localhost:3000/api
  • URL
    http://localhost:3000/api/cases/batchUpsert
  • Auth
    none declared

Request body

Example request

{
  "cases": [
    {
      "location": {
        "country": "GB"
      },
      "travelHistory": {
        "travel": [
          {
            "location": {
              "country": "CR",
              "administrativeAreaLevel1": "Any province in Costa Rica",
              "administrativeAreaLevel2": "Any canton in Costa Rica",
              "administrativeAreaLevel3": "Any district in Costa Rica",
              "place": "Boston Children's Hospital",
              "name": "Lyon, Auvergne-Rhône-Alpes, France"
            }
          }
        ]
      },
      "vaccines": [
        {
          "name": "AstraZeneca",
          "batch": "PV12345"
        }
      ]
    }
  ]
}

Response

OK

phase'GEOCODE' | 'VALIDATE' | 'UPSERT' required

The last operation completed by the server

numCreatednumber required

The number of cases created by the request.

numUpdatednumber required

The number of cases modified by the request. Note that this only includes cases that are actually modified by the batch upsert. If a case is included in the batch upsert request, but contains no changes compared to the currently stored case, it won't be counted.

Example response

{
  "errors": [
    {
      "message": "Cannot parse age"
    }
  ]
}

Changes

    • info

      added the media type application/json for the response with the status

    • warning

      removed the request property //////

    • warning

      removed the request property //////