MedicalTrace

Complete an upload

Record the digest of a document that was uploaded.

Requires asset:update_metadata and the same equipment access as the upload intent. The stored access policy is RESTRICTED. The public passport does not return this file.

1. Request URL

POST https://api.medicaltrace.net/v1/equipment/44444444-4444-4444-8444-444444444444/documents/complete

2. Request parameters

ParameterInRequiredTypeDescription
AuthorizationheaderYesstringBearer token from POST /auth/login. The sample value demo.local.jwt is a placeholder.
X-Organization-IdheaderYesstringManufacturer or current custodian.
idpathYesstringEquipment id.
logicalDocIdbodyYesstringFrom the upload intent.
versionbodyYesnumberFrom the upload intent.
storageKeybodyYesstringFrom the upload intent.
sha256bodyYesstringHex digest of the demo bytes. Do not hash a real certificate into this site.
mediaTypebodyYesstringSame media type as the intent.

3. Request example

curl -s -X POST 'https://api.medicaltrace.net/v1/equipment/44444444-4444-4444-8444-444444444444/documents/complete' \
  -H 'content-type: application/json' \
  -H 'authorization: Bearer demo.local.jwt' \
  -H 'x-organization-id: 11111111-1111-4111-8111-111111111111' \
  -d '{"logicalDocId":"doc_demo_model","version":1,"storageKey":"org/11111111-1111-4111-8111-111111111111/equipment/44444444-4444-4444-8444-444444444444/doc_demo_model/v1","sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","mediaType":"application/pdf"}'

4. Response data

HTTP 201. The body below uses the fictional DEMO-BED-001 fixtures.

{
  "id": "88888888-8888-4888-8888-888888888888",
  "equipmentId": "44444444-4444-4444-8444-444444444444",
  "logicalDocId": "doc_demo_model",
  "version": 1,
  "sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "mediaType": "application/pdf",
  "accessPolicy": "RESTRICTED",
  "scanStatus": "PENDING"
}

5. Response fields

FieldTypeDescriptionExample
sha256stringDigest a later reader compares with a file in hand.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
accessPolicystringDemo default is RESTRICTED.RESTRICTED
scanStatusstringPENDING until a scan worker runs. The demo does not scan the bytes.PENDING