7

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.

user2259674
  • 101
  • 2
  • 5

1 Answers1

2

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

Community
  • 1
  • 1
John Hoerr
  • 7,955
  • 2
  • 30
  • 40