I am exploring Dropbox Business API. I am trying to create a shared folder programmatically from a web application and then share it with bonafide team members.
My First Business Trial App is created with access type : "Team member file access".
FolderMetadata foldermetadata = client.files().createFolderV2(strFolderName).getMetadata();
I get error in the above line of code, though the client used here has TEAM_ADMIN role :
if(com.dropbox.core.v2.team.AdminTier.TEAM_ADMIN == member.getRole()) {
client = teamClient.asMember(profile.getTeamMemberId());
}//end if
12:05:32,385 ERROR [stderr] (default task-42) com.dropbox.core.BadRequestException: Error in call to API function "files/create_folder:2": Unexpected select user header. Your app does not have permission to use this feature
12:05:32,386 ERROR [stderr] (default task-42) at com.dropbox.core.DbxRequestUtil.unexpectedStatus(DbxRequestUtil.java:317)
12:05:32,387 ERROR [stderr] (default task-42) at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:129)
12:05:32,387 ERROR [stderr] (default task-42) at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:300)
12:05:32,387 ERROR [stderr] (default task-42) at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:116)
12:05:32,387 ERROR [stderr] (default task-42) at com.dropbox.core.v2.files.DbxUserFilesRequests.createFolderV2(DbxUserFilesRequests.java:580)
12:05:32,387 ERROR [stderr] (default task-42) at com.dropbox.core.v2.files.DbxUserFilesRequests.createFolderV2(DbxUserFilesRequests.java:607)
I created anothe App with access type : "Team member management".
Now the error is :
(default task-46) com.dropbox.core.v2.sharing.AddFolderMemberErrorException: Exception in 2/sharing/add_folder_member: "no_permission" (user message: You don’t have permission to perform this action.)
12:14:36,337 ERROR [stderr] (default task-46) at com.dropbox.core.v2.sharing.DbxUserSharingRequests.addFolderMember(DbxUserSharingRequests.java:130)
12:14:36,339 ERROR [stderr] (default task-46) at com.dropbox.core.v2.sharing.DbxUserSharingRequests.addFolderMember(DbxUserSharingRequests.java:155)
How do I manage both the actions - to create a Shared Folder and to share it selectively with Team Member(s) ?