Find document¶
Get/Find Documents¶
Endpoint - /documents
HTTP Method GET
The method returns list of documents or folders by 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 into the result |
filter | (optional) Filter parameters |
sort | (optional) Sorting parameters |
pagination | (optional) Returns only the part of the requested data |
Use cases¶
Most uses cases to get documents and/or folder are solved by the proper filter
Get the root folder. All folders and files must be unloaded into the root folder. Need to get root folder id then pass this Id as a 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 the documents with filtering by custom filed
{"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"}}]}}