Provides documentation and guidance on how file uploads can be used in the Public API
All file uploads using the LawVu API requires the use of multipart/form-data
for uploading files. This allows you to send both file content and metadata in a single request.
When uploading a new file, you need to provide details about what resource you want the file to be uploaded to either via the resourceType
and resourceId
form data parts, or from the route e.g. /v2/matters/{matterId}/files
will inherently use resourceType=Matter
and resourceId={matterId}
The following table describes the different resourceType
and resourceId
values
resourceType | resourceId | |
---|---|---|
Matter | {matterId} | Uploads the file to the matter with the ID {matterId} |
Contract | {contractId} | Uploads the file to the contract with the ID {contractId} |
ContractCreation | Uploads the file to be passed for creating a contract |
To create a new file on a matter with the ID 12345, the following request can be used:
Request:
POST /v2/files
Authorization: Bearer <your_access_token>
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="example.pdf"
Content-Type: application/pdf
<file content here>
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="resourceType"
Matter
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="resourceId"
12345
------WebKitFormBoundary7MA4YWxkTrZu0gW--
To create a file on a contract with the ID 67890, use the following request:
Request:
POST /v2/files
Authorization: Bearer <your_access_token>
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="example.pdf"
Content-Type: application/pdf
<file content here>
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="resourceType"
Contract
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="resourceId"
67890
------WebKitFormBoundary7MA4YWxkTrZu0gW--
To upload a file to be used during contract creation, use the following request:
Request:
POST /v2/files
Authorization: Bearer <your_access_token>
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="example.pdf"
Content-Type: application/pdf
<file content here>
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="resourceType"
ContractCreation
------WebKitFormBoundary7MA4YWxkTrZu0gW--
To upload a new version of an existing file, use the following request: Replace {fileId}
with the ID of the file you want to update.
Request:
POST /v2/files/{fileId}
Authorization: Bearer <your_access_token>
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="example.pdf"
Content-Type: application/pdf
<file content here>
------WebKitFormBoundary7MA4YWxkTrZu0gW--
To upload a new file to a folder on an existing Matter or Contract, use the following request:
Request:
POST /v2/files
Authorization: Bearer <your_access_token>
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="example.pdf"
Content-Type: application/pdf
<file content here>
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="resourceType"
Contract
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="resourceId"
67890
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="folder"
45890
------WebKitFormBoundary7MA4YWxkTrZu0gW--
For more details, refer to the Files API documentation.