The current folder listing API call responds with all the contents/items of folder. I have a requirement to filter the contents of a folder based on date. For example I would like to list all the files that were updated/created after 10/05/14 or files updated/created between 2/05/14 to 4/05/14. Instead of listing all the items of a folder.
Can you kindly let me know if this is already supported in BOX api calls?Answer1:
You can do this via the search API. See both the blog post <a href="http://blog.box.com/2014/05/powering-advanced-search-with-the-box-platform/" rel="nofollow">here</a>, as well as the doc <a href="http://developers.box.com/docs/#search" rel="nofollow">here</a>. There are parameters to specify a wide variety of parameters to search for including type of item to look at (file, folder, weblink), specific parent-folders (ancestor_folder_ids), or a couple different date fields.
For example, you could look for only pdf's updated between 15 May 2014 at 1:35PM PST and 17 May 2014 at 1:35PM PST with this curl cmd
curl https://api.box.com/2.0/search?query=sales&file_extensions=pdf&updated_at_range=2014-05-15T13:35:01-07:00,2014-05-17T13:35:01-07:00 \
-H "Authorization: Bearer ACCESS_TOKEN"