Search without a 'query' parameter
I would like to keep track of files' changes and their latest version.
Is there a way,as admin, to get all files in Box of my organization in a flat way, as one big list?
For example, using 'Search' for files by 'modified' / 'created' / 'updated' and receiving all the files that were changed.
The existing 'Search' is 'Search for Content' and requires 'query' parameter, which filters the results by a given string.
What if I want to run the search over all the files in our box organization, regardless the files' content?
For example - getting all files that have changed in the last week.
-
Getting All Files In An Organization
There is currently no API that would directly give you all the files in your organization. But you can get all files belonging to each user in multiple API calls.
You would need to recursively call the Get Folder's Item API to get this data. The process would be:
1. Call Get Folder's Items to get a user's root folders and files by specifying folder id = 0.
2. For all folders returned from step 1, call the Get Folder's Items API for each of them.
3. Repeat this process of calling the Get Folder's Items API until you returned no more subfolders.Keeping Track of Files Changes
Here are two options to monitor for file changes in your organization:
- Set up a webhook to alert you when a new file is uploaded
- Long polling the events endpoint and checking for new file upload events
Please sign in to leave a comment.
Comments
1 comment