You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

skaros's avatar
skaros
Helpful | Level 6
8 years ago

add members to a file/folder

Hi, I am using the dropbox-sdk-java, via Maven, and i unable to find a way to add members to a file(and later to a folder). Could you provide with some pointers? I think i have to use DbxRawClien...
  • Greg-DB's avatar
    8 years ago

    You don't need to use DbxRawClientV2. You should instead use DbxClientV2, as shown in the examples, e.g., here.

     

    Calling addFileMember would look like this:

     

    DbxRequestConfig config = new DbxRequestConfig("example");
    DbxClientV2 client = new DbxClientV2(config, ACCESS_TOKEN);
    
    List<MemberSelector> newMembers = new ArrayList<MemberSelector>();
    MemberSelector newMember = MemberSelector.email("dbapitesting@gmail.com");
    newMembers.add(newMember);
    
    List<FileMemberActionResult> fileMemberActionResults = client.sharing().addFileMember("/test.txt", newMembers);
    System.out.print(fileMemberActionResults);

     

     

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,915 PostsLatest Activity: 24 hours ago
333 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!