<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem sharing folders and adding team members in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-sharing-folders-and-adding-team-members/m-p/303068#M18309</link>
    <description>&lt;P&gt;Thanks for following up. I'm glad to hear you were able to get this working. Yes, that previous access control setting would have prevented you from adding those other accounts, so it looks like this is working as expected.&lt;/P&gt;</description>
    <pubDate>Mon, 15 Oct 2018 15:06:29 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2018-10-15T15:06:29Z</dc:date>
    <item>
      <title>Problem sharing folders and adding team members</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-sharing-folders-and-adding-team-members/m-p/302638#M18293</link>
      <description>&lt;P&gt;I am exploring Dropbox Business API.&amp;nbsp;I am trying to create a shared folder programmatically from a web application and then share it with bonafide team members.&lt;/P&gt;&lt;P&gt;My First Business Trial App is created with access type : "&lt;STRONG&gt;Team member file access&lt;/STRONG&gt;".&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FolderMetadata foldermetadata = client.files().createFolderV2(strFolderName).getMetadata();&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I get error in the above line of code, though the client used here has TEAM_ADMIN role :&lt;BR /&gt;&lt;EM&gt;if(com.dropbox.core.v2.team.AdminTier.TEAM_ADMIN == member.getRole()) {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;client = teamClient.asMember(profile.getTeamMemberId());&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}//end if&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;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&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;12:05:32,386 ERROR [stderr] (default task-42) at com.dropbox.core.DbxRequestUtil.unexpectedStatus(DbxRequestUtil.java:317)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;12:05:32,387 ERROR [stderr] (default task-42) at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:129)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;12:05:32,387 ERROR [stderr] (default task-42) at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:300)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;12:05:32,387 ERROR [stderr] (default task-42) at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:116)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;12:05:32,387 ERROR [stderr] (default task-42) at com.dropbox.core.v2.files.DbxUserFilesRequests.createFolderV2(DbxUserFilesRequests.java:580)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;12:05:32,387 ERROR [stderr] (default task-42) at com.dropbox.core.v2.files.DbxUserFilesRequests.createFolderV2(DbxUserFilesRequests.java:607)&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;I created anothe App with access type : "&lt;STRONG&gt;Team member management&lt;/STRONG&gt;".&lt;/P&gt;&lt;P&gt;Now the error is :&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(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.)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;12:14:36,337 ERROR [stderr] (default task-46) at com.dropbox.core.v2.sharing.DbxUserSharingRequests.addFolderMember(DbxUserSharingRequests.java:130)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;12:14:36,339 ERROR [stderr] (default task-46) at com.dropbox.core.v2.sharing.DbxUserSharingRequests.addFolderMember(DbxUserSharingRequests.java:155)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;How do I manage both the actions - to create a Shared Folder and to share it &lt;STRONG&gt;selectively&lt;/STRONG&gt; with Team Member(s) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:09:55 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-sharing-folders-and-adding-team-members/m-p/302638#M18293</guid>
      <dc:creator>AS131</dc:creator>
      <dc:date>2019-05-29T09:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sharing folders and adding team members</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-sharing-folders-and-adding-team-members/m-p/302726#M18298</link>
      <description>&lt;P&gt;Using a Dropbox Business API app with &lt;A href="https://www.dropbox.com/developers/documentation/http/teams#access-types" target="_blank"&gt;the "team member file access" permission&lt;/A&gt; is the right way to do this. That enables the app to use &lt;A href="https://www.dropbox.com/developers/documentation/http/teams#teams-member-file-access" target="_blank"&gt;the "member file acces" feature&lt;/A&gt;, which includes the ability to create folders, share folders, and add members to shared folders.&lt;/P&gt;
&lt;P&gt;Can you share the full code to reproduce the 'no_permission' error so we can take a look?&amp;nbsp;Thanks in advance!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 15:26:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-sharing-folders-and-adding-team-members/m-p/302726#M18298</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-10-12T15:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sharing folders and adding team members</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-sharing-folders-and-adding-team-members/m-p/302959#M18304</link>
      <description>&lt;P&gt;Hello Greg,&lt;/P&gt;&lt;P&gt;Thanks for your reply, I am unable to attach the full code (getting "An Unexpected Error has occurred" message). So here it is :&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;import com.dropbox.core.DbxException;&lt;BR /&gt;import com.dropbox.core.DbxRequestConfig;&lt;/P&gt;&lt;P&gt;import com.dropbox.core.v2.DbxClientV2;&lt;BR /&gt;import com.dropbox.core.v2.DbxTeamClientV2;&lt;BR /&gt;import com.dropbox.core.v2.files.FolderMetadata;&lt;BR /&gt;import com.dropbox.core.v2.files.FileMetadata;&lt;BR /&gt;import com.dropbox.core.v2.files.ListFolderResult;&lt;BR /&gt;import com.dropbox.core.v2.files.Metadata;&lt;BR /&gt;import com.dropbox.core.v2.sharing.MemberSelector;&lt;BR /&gt;import com.dropbox.core.v2.users.FullAccount;&lt;BR /&gt;import com.dropbox.core.v2.users.FullTeam;&lt;BR /&gt;import com.dropbox.core.v2.sharing.ShareFolderLaunch;&lt;BR /&gt;import com.dropbox.core.v2.sharing.SharedFolderMetadata;&lt;BR /&gt;import com.dropbox.core.v2.sharing.AddMember;&lt;BR /&gt;import com.dropbox.core.v2.team.TeamMemberInfo;&lt;BR /&gt;import com.dropbox.core.v2.team.TeamMemberProfile;&lt;/P&gt;&lt;P&gt;import java.io.FileInputStream;&lt;BR /&gt;import java.io.InputStream;&lt;BR /&gt;import java.io.IOException;&lt;/P&gt;&lt;P&gt;import java.util.Random;&lt;BR /&gt;import java.util.List;&lt;BR /&gt;import java.util.ArrayList;&lt;BR /&gt;import java.util.Iterator;&lt;/P&gt;&lt;P&gt;public class DbxBMain {&lt;BR /&gt;private static final String ACCESS_TOKEN = "****************************************************************"; //Access Token&lt;/P&gt;&lt;P&gt;public static void main(String args[]) throws DbxException, IOException {&lt;BR /&gt;try {&lt;BR /&gt;// Create Dropbox client&lt;BR /&gt;DbxRequestConfig config = new DbxRequestConfig("Dropbox R &amp;amp; D");&lt;BR /&gt;&lt;BR /&gt;DbxTeamClientV2 teamClient = new DbxTeamClientV2(config, ACCESS_TOKEN);&lt;BR /&gt;&lt;BR /&gt;DbxClientV2 client = null;&lt;/P&gt;&lt;P&gt;/********************************************************************************************/&lt;BR /&gt;// Get current account info&lt;BR /&gt;System.out.println("Dropbox Account - Complete Info. : " + teamClient.team().getInfo().toStringMultiline());&lt;/P&gt;&lt;P&gt;/********************************************************************************************/&lt;BR /&gt;// Get current team info - List of team members.&lt;/P&gt;&lt;P&gt;List&amp;lt;TeamMemberInfo&amp;gt; team = teamClient.team().membersList().getMembers();&lt;BR /&gt;if(team != null) {&lt;BR /&gt;Iterator iter = team.iterator();&lt;BR /&gt;while (iter.hasNext()) {&lt;BR /&gt;TeamMemberInfo member = (TeamMemberInfo) iter.next();&lt;BR /&gt;TeamMemberProfile profile = member.getProfile();&lt;/P&gt;&lt;P&gt;System.out.println("\n/--------------------------------------------------------------------------------------------/");&lt;BR /&gt;System.out.println("Team Member - Role : " + member.getRole().toString());&lt;BR /&gt;System.out.println("Team Member Info - Complete Info. : " + member.toStringMultiline());&lt;BR /&gt;System.out.println("/--------------------------------------------------------------------------------------------/\n");&lt;BR /&gt;&lt;BR /&gt;if(com.dropbox.core.v2.team.AdminTier.TEAM_ADMIN == member.getRole()) {&lt;BR /&gt;client = teamClient.asMember(profile.getTeamMemberId());&lt;BR /&gt;}//end if&lt;BR /&gt;}//end while&lt;BR /&gt;}//end if&lt;/P&gt;&lt;P&gt;/********************************************************************************************/&lt;BR /&gt;// Create Folder and add File&lt;BR /&gt;try {&lt;/P&gt;&lt;P&gt;String[] strMails = {"xxxx@xxxxxxxxxx.xxx", "xxxx@xxxxxxxxxx.xxx"};//Random E-Mail IDs - not in any Team / Group&lt;/P&gt;&lt;P&gt;for (int i = 0; i &amp;lt; strMails.length; i++) {&lt;/P&gt;&lt;P&gt;MemberSelector member = MemberSelector.email(strMails[i]);&lt;BR /&gt;System.out.println("\n/--------------------------------------------------------------------------------------------/");&lt;BR /&gt;System.out.println("Email Value : " + member.getEmailValue());&lt;BR /&gt;System.out.println("/--------------------------------------------------------------------------------------------/\n");&lt;BR /&gt;&lt;BR /&gt;String strMemberName = member.getEmailValue().substring(0, (member.getEmailValue().indexOf("@", 1)));&lt;BR /&gt;System.out.println("\n/--------------------------------------------------------------------------------------------/");&lt;BR /&gt;System.out.println("Member Name : " + strMemberName);&lt;BR /&gt;System.out.println("/--------------------------------------------------------------------------------------------/\n");&lt;/P&gt;&lt;P&gt;AddMember am = new AddMember(member);&lt;BR /&gt;List&amp;lt;AddMember&amp;gt; members = new ArrayList&amp;lt;AddMember&amp;gt;();&lt;BR /&gt;members.add(am);&lt;BR /&gt;&lt;BR /&gt;String strFolderName = "/DBX_Test_Folder_" + strMemberName + "_" + Integer.toString(new Random().nextInt(100));&lt;BR /&gt;FolderMetadata foldermetadata = client.files().createFolder(strFolderName);&lt;BR /&gt;System.out.println("\n/--------------------------------------------------------------------------------------------/");&lt;/P&gt;&lt;P&gt;System.out.println("Sharing Folder : " + foldermetadata.getPathDisplay());&lt;BR /&gt;System.out.println("/--------------------------------------------------------------------------------------------/\n");&lt;/P&gt;&lt;P&gt;ShareFolderLaunch sfl = client.sharing().shareFolder(foldermetadata.getPathDisplay());&lt;/P&gt;&lt;P&gt;// Folder sharing&lt;BR /&gt;System.out.println("Shared Folder ID : " + sfl.getCompleteValue().getSharedFolderId());&lt;BR /&gt;client.sharing().addFolderMember(sfl.getCompleteValue().getSharedFolderId(), members);&lt;BR /&gt;} //for&lt;/P&gt;&lt;P&gt;} catch (DbxException ex) {&lt;BR /&gt;System.err.println("Error making API call : " + ex.getMessage());&lt;BR /&gt;System.exit(1);&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;/********************************************************************************************/&lt;/P&gt;&lt;P&gt;System.out.println("\n/--------------------------------------------------------------------------------------------/");&lt;BR /&gt;ListFolderResult result = client.files().listFolderBuilder("").withRecursive(true).start();&lt;BR /&gt;while(true) {&lt;BR /&gt;List&amp;lt;Metadata&amp;gt; entries = result.getEntries();&lt;BR /&gt;for (Metadata metadata : entries) {&lt;BR /&gt;//if (metadata instanceof FileMetadata) {&lt;BR /&gt;//FileMetadata fileMetadata = (FileMetadata) metadata;&lt;BR /&gt;//if (metadata.getPathLower().endsWith(".csv")) {&lt;BR /&gt;System.out.println("Name : " + metadata.getPathLower());&lt;BR /&gt;System.out.println("\n/--------------------------------------------------------------------------------------------/");&lt;BR /&gt;System.out.println("Metadata - Complete Info. : " + metadata.toStringMultiline());&lt;BR /&gt;System.out.println("/--------------------------------------------------------------------------------------------/\n");&lt;BR /&gt;//}//end if&lt;BR /&gt;//}//end if&lt;BR /&gt;}//end for&lt;/P&gt;&lt;P&gt;if(result.getHasMore()) {&lt;BR /&gt;result = client.files().listFolderContinue(result.getCursor());&lt;BR /&gt;} else {&lt;BR /&gt;break; //no more entries to process&lt;BR /&gt;}//end if-else&lt;BR /&gt;}//end while&lt;BR /&gt;&lt;BR /&gt;System.out.println("/--------------------------------------------------------------------------------------------/\n");&lt;/P&gt;&lt;P&gt;/********************************************************************************************/&lt;BR /&gt;} catch(Exception e) {&lt;BR /&gt;e.printStackTrace();&lt;BR /&gt;}//end try-catch&lt;BR /&gt;}//end main&lt;BR /&gt;}//end DbxTest&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I had set the following permissions before I got "No Permission" error :&lt;/P&gt;&lt;BLOCKQUOTE&gt;Sharing files and folders externally - Off&lt;BR /&gt;Editing external folders - Off&lt;BR /&gt;Sharing links externally - Off&lt;BR /&gt;Default shared link privacy - Anyone&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;After making the following changes, the code worked and folders were getting created.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;SPAN&gt;Sharing files and folders externally -&amp;nbsp;On&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Editing external folders - On&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sharing links externally - On&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Default shared link privacy -&amp;nbsp;Team Only&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 07:21:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-sharing-folders-and-adding-team-members/m-p/302959#M18304</guid>
      <dc:creator>AS131</dc:creator>
      <dc:date>2018-10-15T07:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem sharing folders and adding team members</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-sharing-folders-and-adding-team-members/m-p/303068#M18309</link>
      <description>&lt;P&gt;Thanks for following up. I'm glad to hear you were able to get this working. Yes, that previous access control setting would have prevented you from adding those other accounts, so it looks like this is working as expected.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 15:06:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problem-sharing-folders-and-adding-team-members/m-p/303068#M18309</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-10-15T15:06:29Z</dc:date>
    </item>
  </channel>
</rss>

