Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any easy way to get folderID based on a given path?

Tags:

box-api

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.

like image 402
user2259674 Avatar asked Apr 22 '13 17:04

user2259674


People also ask

How to get folder ID BOX?

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 .

How do I find my Google Drive folder ID?

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}".

How do I find the size of a box folder?

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.


1 Answers

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.)

like image 157
John Hoerr Avatar answered Oct 24 '22 19:10

John Hoerr