Sorting and Filter/Query

GET calls that are not by ID support paging and sorting/filtering as defined by each resource.

Tables that are provided in this document for the various resources (such as DPSKs) provide information about any query and sort operators that are available for each property. You can also combine a query with a sort, as well as with paging, in any request.

Sorting Syntax

To sort by a property, the query parameter is "orderBy". The property name is listed first, followed by a colon and the requested sort order: "desc" for descending or "asc" for ascending. For a multiple sort-order request, the order is implied by the order of the properties listed. Invalid properties are ignored and will not affect the sort order nor generate an error.

Note: Root URIs are different for tenant portal APIs and property management APIs. Refer to those sections of this guide for information on root URIs.
added for 5.8 and 5.9

https://cloudpathServer/admin/publicApi/resource?orderBy=prop1:desc,prop2:asc

For an example of a sort, including appending the URI with the sort parameter, see Example of Sorting a GET Call.

Query Operators

The following query operators are supported:

Supported Query Operators

Operator Meaning
like Does a comparison equivalent to a database query of %val% on strings only.
eq Does a direct comparison where the two values must be equal.
in Allows a list of equals to be used, like the "in" operator in a database . This is often used with enumerations, so you can get a list with two or more values in a list of enumerations. Value for the in operator must be: 'val1_val2_val3' where _ is the separator between values.

Query Syntax

To query with a GET of all elements, the query parameter is "filter". This is a list of properties and the operator and value to evaluate, in the format: property( operator:value ). Invalid properties will be ignored, and valid properties will be processed. They will be ordered as provided on the property list, with the first property added first to the filter query.

The following example syntax of filtering on a property called prop1, using the "like' operator with value denoting the value you provide, and also sorting on a property called prop2, using the "eq" parameter and a value for val2:

https://cloudpathServer/admin/publicApi/resource?filter=prop1(like:value),prop2(eq:val2)

For an example of a query, including appending the URI with the filter parameter, see Example of Filtering a GET Call.