cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Check out how our Community members are using Dropbox here!
Close

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to provide the Dropbox-API-Select-User HTTP header with .Net API

Highlighted

How to provide the Dropbox-API-Select-User HTTP header with .Net API

Explorer | Level 3

Hello,

I have gotten my access token through the business app and am trying to make a simple request.  I also have team admin permissions with a permission type for the app as "Team member file access"

using (var dbx = new DropboxClient(AccessToken))
{
                var full = await dbx.Users.GetCurrentAccountAsync();
}

I get the following Error:

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 user.

 

The documentation also mentions specifying a member_id of the user for which the app will run under using a custom HTTP header called Dropbox-API-Select-User.

 

I would first appreciate some help on how to specify this member_id through the header via .Net and then how to access shared files/Folders like "BigFolder" below:

BigFolder.PNG

 

Thank You!

1 Accepted Solution

Accepted Solutions
Highlighted

Re: How to provide the Dropbox-API-Select-User HTTP header with .Net API

Dropboxer
Dropboxer

In the .NET SDK in particular, to set the "Dropbox-API-Select-User" header, you should use the DropboxTeamClient.AsMember method.

 

And to access the contents of the "team space", as shown in your screenshot, you should use the DropboxClient.WithPathRoot method. Check out the Namespace Guide for information on how that works.

View solution in original post

2 Replies 2
Highlighted

Re: How to provide the Dropbox-API-Select-User HTTP header with .Net API

Dropboxer
Dropboxer

In the .NET SDK in particular, to set the "Dropbox-API-Select-User" header, you should use the DropboxTeamClient.AsMember method.

 

And to access the contents of the "team space", as shown in your screenshot, you should use the DropboxClient.WithPathRoot method. Check out the Namespace Guide for information on how that works.

View solution in original post

Highlighted

Re: How to provide the Dropbox-API-Select-User HTTP header with .Net API

Explorer | Level 3

Thank you very much.  Solved my issue!

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?