Sorting Responses
Sorting Responses
Where an API returns a collection of items it often supports sorting of API responses.
Use the sort
and direction
query parameters to sort the collection either in
ascending or descending order.
curl https://api.box.com/2.0/folders/0/items?sort=size&direction=DESC \
-H "authorization: Bearer ACCESS_TOKEN"
Sorting criteria
The field to sort on is defined by the sort
query parameter. Check the API
endpoint's documentation for the possible options for this value.
Sorting direction
The sorting direction supports two values, either ASC
for ascending order, or
DESC
for the reverse.