Files and Folders
Create, add and update files and folders
Structure
Every Matter has a familiar folder structure used to store files and documents:
If you want to work with the folder/file structure, then you will need to use the GET folders endpoint. Alternatively, if you prefer to work with a flat list of all Files on the Matter, you can use the GET files endpoint.
The root folder of a matter will always have an id of null
and if no folder id is specified when adding a File, this is the folder that will be used by default.
Every folder including the root folder, will have a a number of sub-folders and files. When retrieveing a folder from the Folders endpoint you will get a list of the sub-folders and files in that folder. Here is a response for root folder of the Matter shown above:
** Response **
Adding a File
Adding a File to a Matter is a two-step process involving creating the meta-data for the File by POSTing to the files endpoint and then using the response to upload the actual file to the provided URL.
Continuing with the Matter example above, if we wanted to add a File to the Correspondence folder we would make the following request:
Response
You will get back the fileId
of the new File and an uploadUrl
that you can use to upload the actual file to AWS S3 with a PUT request. The uploadUrl will be valid up until the time specified in the expiry
field.
For detailed instructions on uploading files using pre-signed S3 URLs, see the AWS documentation on using presigned URLs. The documentation covers request headers, content types, and example code in multiple languages.
Uploading a new version
To upload a new version of a file to an existing File on a Matter you need to get a new upload URL from the files endpoint:
Response
You will get back an uploadUrl
that you can use to upload the new version to AWS S3 with a PUT request. The uploadUrl will be valid up until the time specified in the expiry
field.
For detailed instructions on uploading files using pre-signed S3 URLs, see the AWS documentation on using presigned URLs. The documentation covers request headers, content types, and example code in multiple languages.
Downloading a File
To download a file you need to make a request to the files endpoint to get a temporary downloadUrl
:
Response
The
downloadUrl
will be valid up until the time specified in theexpiry
field.