How to upload a file
The Document Service API is the entry point to upload files in Clearance.
Files are represented as resources in the API, and the resources are grouped under one Evidence item.
An Evidence entity represents ONE digital evidence item, but sometimes more than one file (resource) is required because different representations of the same data are possible or meta-data is required to complete a media file.
![FileEvidence.png 342](https://files.readme.io/b7da43f-FileEvidence.png)
To upload a file, using the Document Service API after authenticated to the STS you must:
![UploadEvidence.png 587](https://files.readme.io/7da3a9e-UploadEvidence.png)
- Create a new evidence item. The system will, in the background, create a new container in Azure Storage
- Create a new resource for the first file to upload. The system will return a URI that contains an Azure SAS token
- Upload the encrypted file using Azure Storage SDK or Azure Storage REST API
- After the upload is completed, notify Clearance that this resource is completed.
POST {BaseURL}/tenant/{tenantId}/evidence/{evidenceId}/resource/{resourceId}/complete - Do step 2 to 4 for every file you need to include in the evidence.
- Notify Clearance that your evidence is completed.
If the evidence and the resource are not completed, Clearance will purge the incomplete file 24 hours later.
Parallel upload
The system is designed to permit upload of up to 5 file/resource in parallel with one Evidence item. It is possible to upload the data from many evidences in parallel. The number of parallel uploads needs to be allocated based on the bandwidth available between the offline recording device and the HTTP upload service.
Updated over 3 years ago