Dropbox API

Sharing a file

Inviting a member to a shared file using the Dropbox Java library

This uses the Dropbox Java SDK to share a file at “/test.txt” with a specific user:

List<MemberSelector> newMembers = new ArrayList<MemberSelector>();
MemberSelector newMember = MemberSelector.email("<EMAIL_ADDRESS_TO_INVITE>");
newMembers.add(newMember);

List<FileMemberActionResult> fileMemberActionResults = client.sharing().addFileMember("/test.txt", newMembers);
System.out.print(fileMemberActionResults);

<EMAIL_ADDRESS_TO_INVITE> should be replaced with the email address of the user to invite. Also, newMembers is an array and can contain multiple users.


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow