问题
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?
回答1:
You can do this via the search API. See both the blog post here, as well as the doc here. 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"
来源:https://stackoverflow.com/questions/24007065/filter-folder-listing-based-on-date