cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Cursor at team root level

Cursor at team root level

jerry14
Explorer | Level 4

I am trying to fetch changes from multiple shared folders and user's folders from a business account. Its initially fetched by iteratively calling list_folder and list_folder_continue for each folder I am interested in.  My question is, to fetch changes later on, do I need to store the cursor for each folder or is there a way to get a single cursor that can be used for all the folders? Anything at root namespace level that I can store?

 

Thanks

3 Replies 3

Greg-DB
Dropbox Staff

You can call list_folder with "path": "" (that is, the empty string), and "recursive": true (if desired), to list everything under the root. The resulting cursors for all further calls resulting from that will retain those settings so you can store and continue to use those over time.

 

I recommend reading the File Access Guide and Team Files Guide, if you haven't already.

jerry14
Explorer | Level 4

Thanks for the response. In that case, would it work for teams following the "Team Folder" structure (as in Team Space vs Team Folder) . Team Folder structure, as I understood, will have the user's home folder as the root ("") which will not cover other users. We are using team admin access token to fetch details for all users. I have gone through both linked guides, but couldn't get a clarity on this. 

 

Greg-DB
Dropbox Staff

Calling list_folder with "path": "" will start listing everything under the "root" for the call, for either team configuration. By default, the root for a call is the "home" folder (i.e., the member's individual folder). For teams with the team folder configuration, that would include anything in their account. For teams with the team space configuration, it wouldn't contain the team space, since that is at a higher level than the member folder.

 

You can change the root for the call though, e.g., to access the team space (or any other specific team folder or shared folder) using the 'Dropbox-API-Path-Root' header as covered in the Team Files Guide.

 

So, for teams with the team space configuration, you can set the root accordingly and use "path": "" to easily list everything under the team space.

 

For teams with the team folder configuration though, you'd only get the contents under the member's particular folder, which may not be all of the team folders that the team has. If you need everything across an entire team with team folder configuration, you may want to start with /2/team/namespaces/list[/continue] instead (the Team Files Guide also goes over this) to list every namespace and then list the contents of each namespace as needed using /2/files/list_folder[/continue].

Need more support?