<?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: .Net API SDK - Best way to connect to a Business Dropbox? in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Net-API-SDK-Best-way-to-connect-to-a-Business-Dropbox/m-p/397097#M1016</link>
    <description>&lt;P&gt;This error message indicates that the access token you're using is for a "Dropbox Business API" app, which connects to entire&amp;nbsp;Dropbox Business teams, but the method you're trying to use is for specific&amp;nbsp;Dropbox accounts.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want any kind of&amp;nbsp;Dropbox account (Business or not) to be able to connect to your app, you should instead &lt;A href="https://www.dropbox.com/developers/apps/create" target="_self"&gt;register&lt;/A&gt; a "Dropbox API" app. That kind of app needs to be authorized by each end-user, at which point the app receives&amp;nbsp;an access token for that user's account and can call methods like&amp;nbsp;GetCurrentAccountAsync without additional configuration.&lt;/P&gt;
&lt;P&gt;Alternatively, if you only want to connect Business accounts, you can use your "Dropbox Business API" app registration. That kind of app only need to be authorized by a team admin, at which point the app receives&amp;nbsp;an access token for that entire team. Your app would then need to additionally specify which team member to operate on when making an account-specific call such as&amp;nbsp;GetCurrentAccountAsync. You can do so by first making a&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/T_Dropbox_Api_DropboxTeamClient.htm" target="_self"&gt;DropboxTeamClient&lt;/A&gt; object and calling&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_DropboxTeamClient_AsMember.htm" target="_self"&gt;DropboxTeamClient.AsMember&lt;/A&gt; with the relevant team member ID to get a&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/T_Dropbox_Api_DropboxClient.htm" target="_self"&gt;DropboxClient&lt;/A&gt; for that team member.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Feb 2020 16:17:24 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2020-02-14T16:17:24Z</dc:date>
    <item>
      <title>.Net API SDK - Best way to connect to a Business Dropbox?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Net-API-SDK-Best-way-to-connect-to-a-Business-Dropbox/m-p/396942#M1015</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are in the process of adding Dropbox support to our application.&amp;nbsp; Basically this is so users have an option to store attachments in Dropbox (user creates a sales order in our app and wants to attach a Word doc to it for instance).&amp;nbsp; We are using the .Net Dropbox assemblies for this.&amp;nbsp; I have used the dropbox console to create a an app and created an access token for it.&amp;nbsp; I'm then using this code to try to connect -&lt;BR /&gt;&lt;BR /&gt;DropboxClient dbx =&lt;BR /&gt;new DropboxClient("XXXXXX");&lt;BR /&gt;&lt;BR /&gt;var result = await dbx.Users.GetCurrentAccountAsync();&lt;BR /&gt;var nameSpace = result.RootInfo.RootNamespaceId;&lt;BR /&gt;dbx = dbx.WithPathRoot(new PathRoot.Root(nameSpace));&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;But I get the following error when I the GetCurrentAccount call runs -&lt;BR /&gt;&lt;EM&gt;Error in call to API function "users/get_current_account": &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;This API function operates on a single Dropbox account,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;but the OAuth 2 access token you provided is for an entire Dropbox Business team. &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Since your API app key has team member file access permissions, you can operate on a team member's Dropbox by providing the "Dropbox-API-Select-User" HTTP header or "select_user" URL parameter to specify the exact user &amp;lt;&lt;A href="https://www.dropbox.com/developers/documentation/http/teams" target="_blank" rel="noopener"&gt;https://www.dropbox.com/developers/documentation/http/teams&lt;/A&gt;&amp;gt;.&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I have not been able to find a C# sample that works yet for this.&amp;nbsp; Is there another way or what is the recommended way of doing this?&amp;nbsp; I would prefer to not have each user having to authenticate each time they want to access an attachment through our application.&lt;/P&gt;&lt;P&gt;I have cross-posted this in the API Support forum as well in case it gets more visibility there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 14:02:27 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Net-API-SDK-Best-way-to-connect-to-a-Business-Dropbox/m-p/396942#M1015</guid>
      <dc:creator>tcnsdca</dc:creator>
      <dc:date>2020-02-14T14:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: .Net API SDK - Best way to connect to a Business Dropbox?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Net-API-SDK-Best-way-to-connect-to-a-Business-Dropbox/m-p/397097#M1016</link>
      <description>&lt;P&gt;This error message indicates that the access token you're using is for a "Dropbox Business API" app, which connects to entire&amp;nbsp;Dropbox Business teams, but the method you're trying to use is for specific&amp;nbsp;Dropbox accounts.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want any kind of&amp;nbsp;Dropbox account (Business or not) to be able to connect to your app, you should instead &lt;A href="https://www.dropbox.com/developers/apps/create" target="_self"&gt;register&lt;/A&gt; a "Dropbox API" app. That kind of app needs to be authorized by each end-user, at which point the app receives&amp;nbsp;an access token for that user's account and can call methods like&amp;nbsp;GetCurrentAccountAsync without additional configuration.&lt;/P&gt;
&lt;P&gt;Alternatively, if you only want to connect Business accounts, you can use your "Dropbox Business API" app registration. That kind of app only need to be authorized by a team admin, at which point the app receives&amp;nbsp;an access token for that entire team. Your app would then need to additionally specify which team member to operate on when making an account-specific call such as&amp;nbsp;GetCurrentAccountAsync. You can do so by first making a&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/T_Dropbox_Api_DropboxTeamClient.htm" target="_self"&gt;DropboxTeamClient&lt;/A&gt; object and calling&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_DropboxTeamClient_AsMember.htm" target="_self"&gt;DropboxTeamClient.AsMember&lt;/A&gt; with the relevant team member ID to get a&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/T_Dropbox_Api_DropboxClient.htm" target="_self"&gt;DropboxClient&lt;/A&gt; for that team member.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 16:17:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Net-API-SDK-Best-way-to-connect-to-a-Business-Dropbox/m-p/397097#M1016</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-02-14T16:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: .Net API SDK - Best way to connect to a Business Dropbox?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Net-API-SDK-Best-way-to-connect-to-a-Business-Dropbox/m-p/397114#M1017</link>
      <description>&lt;P&gt;I have been trying to use the AsMember method and it seems to always throw this error when I use it - "Invalid select user id format"&lt;/P&gt;&lt;P&gt;DropboxTeamClient teamClient = new DropboxTeamClient(OAUTHTOKEN);&lt;/P&gt;&lt;P&gt;var results = await teamClient.Team.MembersListAsync();&lt;/P&gt;&lt;P&gt;string memberID = string.Empty;&lt;BR /&gt;foreach (var member in results.Members)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if (member.Profile.Email.Equals("tcash@mac.com", StringComparison.OrdinalIgnoreCase))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; memberID = member.Profile.AccountId;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (memberID.StartsWith("dbid:", StringComparison.OrdinalIgnoreCase))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; memberID = memberID.Substring(5);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;var dbx = teamClient.AsMember($"dbmid:{memberID}");&lt;/P&gt;&lt;P&gt;The member ID I get from the member profile is in the format of "dbid:XXXXXX", while the code I have found in the forms seems to want to set it as "dbmid:XXXXXX".&amp;nbsp; I've tried both styles and neither worked.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 16:54:47 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Net-API-SDK-Best-way-to-connect-to-a-Business-Dropbox/m-p/397114#M1017</guid>
      <dc:creator>tcnsdca</dc:creator>
      <dc:date>2020-02-14T16:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: .Net API SDK - Best way to connect to a Business Dropbox?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Net-API-SDK-Best-way-to-connect-to-a-Business-Dropbox/m-p/397117#M1018</link>
      <description>&lt;P&gt;The AsMember method expects the "team member ID", which is the ID that starts with "dbmid:".&amp;nbsp;Dropbox supplies these values directly, and you should not attempt to modify them.&lt;/P&gt;
&lt;P&gt;The team member ID is available as&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Team_MemberProfile_TeamMemberId.htm" target="_self"&gt;MemberProfile.TeamMemberId&lt;/A&gt; (not&amp;nbsp;MemberProfile.AccountId).&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 16:58:53 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Net-API-SDK-Best-way-to-connect-to-a-Business-Dropbox/m-p/397117#M1018</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-02-14T16:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: .Net API SDK - Best way to connect to a Business Dropbox?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Net-API-SDK-Best-way-to-connect-to-a-Business-Dropbox/m-p/397118#M1019</link>
      <description>&lt;P&gt;Ok, so I did try using that value and it gave me the same error.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 16:59:48 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Net-API-SDK-Best-way-to-connect-to-a-Business-Dropbox/m-p/397118#M1019</guid>
      <dc:creator>tcnsdca</dc:creator>
      <dc:date>2020-02-14T16:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: .Net API SDK - Best way to connect to a Business Dropbox?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Net-API-SDK-Best-way-to-connect-to-a-Business-Dropbox/m-p/397159#M1020</link>
      <description>&lt;P&gt;Can your share your current code for that? I just modified your earlier code and it worked fine for me:&lt;/P&gt;
&lt;PRE&gt;DropboxTeamClient teamClient = new DropboxTeamClient(ACCESS_TOKEN);

var results = await teamClient.Team.MembersListAsync();

string memberID = string.Empty;
foreach (var member in results.Members)
{
    if (member.Profile.Email.Equals(EMAIL_ADDRESS, StringComparison.OrdinalIgnoreCase))
    {
        memberID = member.Profile.TeamMemberId;
        break;
    }
}
//or use MembersGetInfoAsync to look up a specific member directly

var dbx = teamClient.AsMember(memberID);
var result = await dbx.Users.GetCurrentAccountAsync();&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Feb 2020 19:10:55 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Net-API-SDK-Best-way-to-connect-to-a-Business-Dropbox/m-p/397159#M1020</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-02-14T19:10:55Z</dc:date>
    </item>
  </channel>
</rss>

