Upload the group of files

Create and populate a file group iteratively for each laboratory analysis to be digitized.

  1. (Optional, if uploading more than one laboratory test result). Create a filegroup, passing the previously obtained file set ID (filesetId) in the request body. In the response, you will receive the ID of the created filegroup.
curl --location 'https://api.ornament.health/public/file-api/v1.0/filegroup' \
--header 'Content-Type: application/json' \
--header 'Authorization: •••' \
--data '{"filesetId":1056}'
  1. Sequentially send the following POST requests to upload all files related to a laboratory test into the group. Replace the {filegroup_id} with the previously obtained ID of the filegroup. In response to each request.
curl --location '.../public/file-api/v1.0/filegroup/1338/attach_file/' \
--form 'file=@"/C:/Users/SP/Downloads/Kristina_short.pdf"'

📘

Note that the attached file should have the “file” key.

In the response, you will receive confirmation of successful file upload and its metadata.

{
    "id": 648411,
    "fileId": 250975,
    "ssoId": "db7eb07f-b159-4b40-8c16-421c42beea35",
    "filename": "Kristina_short.pdf",
    "filetype": "application/pdf",
    "createdAt": 1710451900,
    "hash": "7A947294E1B5939315E111C51206B9686CECB2CF1BC327B67E81ABF12E14D5A7"
}

📘

Bulk upload is not supported; each file must be uploaded with a separate request.