Find document¶
Get/Find Documents¶
Endpoint - /documents
HTTP Method GET
Returns a list of documents or folders that match the specified criteria.
Request¶
Headers¶
| Parameter | Description |
|---|---|
| clientname | (mandatory) Portfolio name |
| authorization | (mandatory) Authentication token |
| projectId | (mandatory) Project identifier |
| select | (optional) List of fields to include in the result |
| filter | (optional) Filter parameters |
| sort | (optional) Sorting parameters |
| pagination | (optional) Returns only the part of the requested data |
Use cases¶
Most use cases for retrieving documents and folders are solved by applying the right filter.
Get the root folder. All folders and files reside under the root folder. Retrieve the root folder ID and pass it as the Parent Id.
{"bool":{"must":[{"equals":{"IsFolder":true}}, {"is\empty": "Parent"}]}}Get subfolders of the folder
{"bool":{"must":[{"equals":{"IsFolder":true}}, {"equals": {"Parent.Id": "723d3996-6b6d-4429-93bc-0d9bb4472e31"}}]}}Find a document by name (in the entire project)
{"bool":{"must":[{"equals":{"IsFolder":false}}, {"equals": {"Name": "230500-AHU C1 Performance Data.pdf"}}]}}Find a document by name (in the specific folder)
{"bool":{"must":[{"equals":{"IsFolder":false}}, {"equals": {"Parent.Id": "723d3996-6b6d-4429-93bc-0d9bb4472e31"}}, {"equals": {"Name": "230500-AHU C1 Performance Data.pdf"}}]}}Find documents by a custom field value
{"bool":{"must":[{"equals":{"CustomFields[f6194a0f-4d4b-451d-9eb0-62d24f58b72c].Value":"A1"}},{"equals":{"Name":"03-Maintenance Guide A"}}]}}Find the documents updated after a certain time
{"bool":{"must":[{"equals":{"IsFolder":false}}, {"greater\than\or\equals": {"ModifiedOn": "2021-03-26T13:19:29.683Z"}}]}}