Box api is implemented to be RESTful. and most supported methods are based on ids, folder_id or file_id.
As a very beginning start point, a root folder id, 0, stands for the root directory /All Files/.
from there (fold_id = 0), I can loop through all sub folders and find folder id for certain target folder.
or I can send search request to "https://api.box.com/2.0/search?query=target_folder_name", and process the response to locate target folder.
The former approach may need multiple list-folder-item requests, and the latter approach might be slow because the search is not just for folder/file name but also for other attributes of folder/file and even file content.
I am wondering if there is an easy way to find folder id for certain folder with a given path, such as "/All Files/MyFolder_A/Project_11".
Thank you very much for any help.
The ID for any folder can be determined by visiting this folder in the web application and copying the ID from the URL. For example, for the URL https://*.app.box.com/folder/123 the folder_id is 123 . The root folder of a Box account is always represented by the ID 0 .
Getting the Google Drive Folder ID is easy. Just go to drive.google.com/drive/my-drive and open the folder you need. After you open the folder, the URL changes to something like this: "https://drive.google.com/drive/folders/{folder-id}".
The size can be determined in the details side panel in a folder in Box. If you click on the Details name next to Share, you'll see the sidebar with all the relevant info of the folder you have clicked in including the size at the bottom.
To the best of my knowledge, walking the folder tree (as you've suggested) is still the fastest way to get the ID of a particular file/folder. (See also this question: Get file ID of a given path.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With