Search code examples
box-apiboxapiv2

Is it possible to set the order of returned folder item's in the Box REST API?


The response has the order the results were returned in, but is it possible to set the order in the request?

It is possible to set the limit and offset when executing the Get a Folder’s Items, but this functionality seems incomplete if the order can't be supplied.

As per the documentation example, a limit and offset URL parameter can be set.

curl https://api.box.com/2.0/folders/FOLDER_ID/items?limit=2&offset=0 \
-H "Authorization: Bearer ACCESS_TOKEN"

Solution

  • Unfortunately, it currently isn't possible to customize the order of items returned by the API.

    The limit and offset parameters are used to page through large arrays, since it's possible for a folder to have thousands of items which can't all be returned in a single response.