Sorting
The sort query parameter allow the client to sort the collections based on property values. The property is determined by the value of the sort query parameter.
The value of the sort parameter contains a comma-separated list of expressions used to sort the items.
Sort Direction The expression can include the suffix "asc" for ascending or "desc" for descending, separated from the property name by one or more spaces. If "asc" or "desc" is not specified, the service order by the specified property in ascending order.
For example: GET /agreements?sort=name
curl -k -i -H "Content-Type: application/json"\
-H "X-Token: {api-token}"\
-X GET 'https://{host-name}/agreements?sort=name'
Will return all agreements sorted by name in ascending order.
For example: GET /agreements?sort=name desc
curl -k -i -H "Content-Type: application/json"\
-H "X-Token: {api-token}"\
-X GET 'https://{host-name}/agreements?sort=name desc'
Will return all agreement sorted by name in descending order.
Sub-sorts
Client can specify multiple sort expressions on different properties, In that case items are sorted by the result values of the first expression, and then items with the same value for the first expression are sorted by the result value of the second expression, and so on.
For example: GET /agreements?sort=name desc, status
curl -k -i -H "Content-Type: application/json"\
-H "X-Token: {api-token}"\
-X GET 'https://{host-name}/agreements?sort=name desc, status'
Will return all agreements sorted by name in descending order and a secondary sort order of status in ascending order.