Sort and Filter
Several of the Files.com API resources have list operations that return multiple instances of the resource. The List operations can be sorted and filtered.
Sorting
To sort the returned data, use the sort_by query parameter.
| Component | Description |
|---|---|
<field> | The name of the field to sort by, placed within square brackets []. Each resource supports a unique set of valid sort fields and can only be sorted by one field at a time. |
<value> | The sort order: asc (ascending) or desc (descending). |
Special note about the List Folder Endpoint
For historical reasons, and to maintain compatibility with a variety of other cloud-based MFT and EFSS services, Folders will always be listed before Files when listing a Folder. This applies regardless of the sorting parameters you provide. These will be used, after the initial sort application of Folders before Files.
Filtering
Filters apply selection criteria to the underlying query that returns the results. They can be applied individually or combined with other filters, and the resulting data can be sorted by a single field.
Each resource supports a unique set of valid filter fields, filter combinations, and combinations of filters and sort fields.
| Component | Description |
|---|---|
<filter> | The filter to use. |
<field> | The name of the field to filter by, placed within square brackets []. Each resource supports a unique set of valid filter fields. |
<value> | The field value that the filter should apply to. |
Filter Types
| Filter | Type | Description |
|---|---|---|
filter | Exact | Find resources that have an exact field value match to a passed in value. (i.e., FIELD_VALUE = PASS_IN_VALUE). |
filter_prefix | Pattern | Find resources where the specified field is prefixed by the supplied value. This is applicable to values that are strings. |
filter_gt | Range | Find resources that have a field value that is greater than the passed in value. (i.e., FIELD_VALUE > PASS_IN_VALUE). |
filter_gteq | Range | Find resources that have a field value that is greater than or equal to the passed in value. (i.e., FIELD_VALUE >= PASS_IN_VALUE). |
filter_lt | Range | Find resources that have a field value that is less than the passed in value. (i.e., FIELD_VALUE < PASS_IN_VALUE). |
filter_lteq | Range | Find resources that have a field value that is less than or equal to the passed in value. (i.e., FIELD_VALUE <= PASS_IN_VALUE). |