Sorting

API calls that support the sort query parameter support returning their results in a sorted array. The sort query parameter can be used to specify the name of any single field in the response object to sort the results by. For example, to return a list of queues sorted by name:

curl -kvs -c cookies.txt -b cookies.txt 'https://localhost:8080/queues?sort=name'

Fields in nested objects can also be chosen as the sort field. To specify a nested field, use a period (.) as a hierarchical separator. For example, to return a list of queues sorted by the value of their pending_message_count statistic inside the "statistics" object of a queue:

curl -kvs -c cookies.txt -b cookies.txt 'https://localhost:8080/queues?sort=statistics.pending_message_count'

By default, results are sorted in ascending order. To sort in descending order, prefix a minus sign (-) to the sort field name. For example, to list queues starting with the queue with the highest pending_message_count first:

curl -kvs -c cookies.txt -b cookies.txt 'https://localhost:8080/queues?sort=-statistics.pending_message_count'

At present, only one field may be sorted on at a time.