Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
after getting a token using this method.
client = new DropboxTeamClient(request.AccessToken, request.RefreshToken, request.Expires, ClientIdBusiness,
ClientSecretBusiness);
then i am trying to get the account using
var account = await client.AsMember(request.AsMember).Users.GetCurrentAccountAsync();
but then i am getting the error below ?
i am using this method in order to check if the account is the new Dropbox Space Team or the old one
if (account.RootInfo.IsTeam)
am I missing something ?
v=
: Error in call to API function ""users/get_current_account"": This API function operates on a single Dropbox account, but the OAuth 2 access token you provided is for an entire Dropbox Business team. 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 use
i am using the latest SDK Version 6.33.0.0
Using the AsMember method is the right way to set the "Dropbox-API-Select-User" header with the .NET SDK. Your code itself looks fine, but the issue may be with the value you're using. Make sure your "request.AsMember" variable is properly set to the team member ID of the team member you wish to call on behalf of. For instance, if you are actually passing an empty string there, you will get this error.
(By the way, if you just want to connect to a particular account and don't need to call any team methods, you can disable any team scopes and get a new access token and refresh token without them. The access token without the team scopes will be specific to the particular account, Business or not, and so will not require the additional "Dropbox-API-Select-User" header. You can find more information on scopes in the OAuth Guide. If you don't need to call any team methods, e.g., if you just need to call individual endpoints, such as GetCurrentAccountAsync, I recommend this solution instead for simplicity and security.)
Hi there!
If you need more help you can view your support options (expected response time for a 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!