cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
If you’ve changed your email address, now's the perfect time to update it on your Dropbox account and we’re here to help! Learn more here.

Discuss Dropbox Developer & API

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

How to navigate to Team root with JDK

How to navigate to Team root with JDK

bauerb
Explorer | Level 3

I have been trying all day to access my team's root folder with the Java SDK and I haven't been able to find any documentation.

 

My folder structure is like this:

 

 

/MyName
/Folder-I-Want-To-Access
/Other-Folder-I-Want-To-Access

 

 

 

Unfortunately I'm trying to do this in Rhino, so apologies that this doesn't look like normal Java 🤦‍:male_sign: I don't really know where to go from here:

 

 

 

var config = new com.dropbox.core.DbxRequestConfig("dropbox/java-tutorial", "en_US");
var teamClient = new com.dropbox.core.v2.DbxTeamClientV2(config, accessToken);
var client = teamClient.asMember('my-id');

 

 

 

 the TeamClient doesn't have the file access methods, but the individual Client always has it's root set to /MyName. How can I navigate paths with the JDK?

1 Reply 1

Greg-DB
Dropbox Staff

It sounds like you want access the folders in your "team space". By default, Dropbox API calls operate in the "member folder", not the team space, but you can configure them to operate in the team space when desired, by setting the "Dropbox-API-Path-Root" header. For information on how to do so, please refer to the Team Files Guide.

 

With the Java SDK in particular, you can set the "Dropbox-API-Path-Root" header using the DbxClientV2.withPathRoot method.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?