When you request a list of objects using the GET
method, you can specify the parameters to sort the list by. Sorting is set in the request using the sort query parameter.
Lists of objects support various sorting options. For more information about the parameters, see the GET
request description for each object.
You can sort values in ascending or descending order.
For example, when using sort=id
, the list is sorted by identifier values in ascending order. To change the sorting direction to descending, add a hyphen before the parameter: sort=-id
.
When sorting, you can use one or multiple parameters at once. Simply specify them separated by a comma: param1,param2
.
The order of parameters affects the sorting sequence.
For example, when using sort=param1,param2
, the list is sorted in ascending order by the param1
values first, and then by the param2
values. To change the sorting sequence, switch the parameters around: sort=param2,param1
.