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: 

Dropbox Java SDK List Shared Links of a Team Folder in Business Account

Dropbox Java SDK List Shared Links of a Team Folder in Business Account

abhinovClairvoyant2
Helpful | Level 5
Go to solution

I am trying to access all shared links in dropbox business account (team folder) using Java SDK.

 

I am able to get shared Link Metadatas for files inside personal space of a particular member of the team - 

List<SharedLinkMetadata> sharedLinkMetadataList = client.asMember(memberId).sharing().listSharedLinks().getLinks(); 

But, this does not return the shared links of the team folder and files within the teamspace.  How can I list the shared links of all files and folders within the team folder? Using client.asAdmin() does not work 

client.asAdmin(memberId).sharing().listSharedLinks().getLinks()

 

For reference, I am NOT able to get shared links inside teamSpace folder

Screenshot from 2023-03-06 09-45-48.png

1 Accepted Solution

Accepted Solutions

Здравко
Legendary | Level 20
Go to solution

Hi @abhinovClairvoyant2,

Did you set proper root namespace for your call? 🧐😉

Hope this gives direction.

View solution in original post

3 Replies 3

Здравко
Legendary | Level 20
Go to solution

Hi @abhinovClairvoyant2,

Did you set proper root namespace for your call? 🧐😉

Hope this gives direction.

Greg-DB
Dropbox Staff
Go to solution

@abhinovClairvoyant2 As Здравко noted, in order to access the contents of the team space, you'll need to set the root for the call to the team space. You can find information on how that works in the Team Files Guide they linked to. For the Java SDK in particular, you'd use the withPathRoot method to set that header.

abhinovClairvoyant2
Helpful | Level 5
Go to solution

Thank you. 😀

After setting the root namespace it works

 

String rootNS =
client.asAdmin(memberId).users().getCurrentAccount().getRootInfo().getRootNamespaceId();

List<SharedLinkMetadata> sharedLinkMetadataList = client
.asMember(memberId)
.withPathRoot(PathRoot.namespaceId(rootNS))
.sharing()
.listSharedLinks()
.getLinks();
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    abhinovClairvoyant2 Helpful | Level 5
  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?