We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
InfiAdmin
20 days agoExplorer | Level 3
Retrieve List of Users via Dropbox C# DLL
Dear Dropbox Support Team,
I hope this message finds you well.
We are currently working on integrating Dropbox functionality into our C# application using the official Dropbox SDK (DLL). Our objective is to retrieve a list of all users associated with our Dropbox account programmatically.
We would appreciate your assistance in guiding us on how to accomplish this using the SDK. Specifically, we are looking for:
The appropriate method(s) or endpoint(s) in the SDK to list all users in our Business account.
Any prerequisites or permissions (e.g., access scopes or account-level permissions) required to perform this operation.
A sample code snippet (if available) demonstrating how to perform this in C#.
We are using the following environment:
SDK: Dropbox Api
Language: C#
Application Type: Dropbox Business
Please let us know if additional setup or specific API access is required. We are also open to using Dropbox Business API endpoints if DLL methods are limited for this purpose.
Thank you in advance for your support and guidance.
4 Replies
- DB-Des13 days ago
Dropbox Community Moderator
In order to get a refresh token, you will need to request "offline" access. Refresh tokens do not expire automatically and can be used repeatedly. You can find more information in the OAuth Guide and authorization documentation. There's a basic outline of processing this flow in this blog post which may serve as a useful example.
As far as scopes needed, that's dependent on the endpoint(s) you are planning on using. You can see which scope is required for each endpoint in the API documentation: https://www.dropbox.com/developers/documentation/http/documentation
- InfiAdmin13 days agoExplorer | Level 3
I Have Team Plan In Dropbox
Can You Give me the best way to Get Refresh-Token Which Used For All Team Members To Access or Download data.
And Which Parameter and Scopes Need
Thank You
- InfiAdmin13 days agoExplorer | Level 3
Thank you
- DB-Des19 days ago
Dropbox Community Moderator
Hi InfiAdmin
To list all users in your Dropbox Business account using the .NET SDK, you'll want to use the 'Team.MembersListV2Async()' method from the 'DropboxTeamClient' class. This corresponds to the /2/team/members/list_v2 endpoint and allows you to retrieve a list of all team members.
In order to paginate through additional results, you will need to check the value of the 'HasMore' property, which is returned in the response. If the value is 'True', you will need to obtain the value of the 'Cursor' property, and then use the 'Team.MembersListContinueV2Async()' method (as needed) to retrieve any additional results until 'HasMore' returns 'False'. This would be corresponding to the /2/team/members/list/continue_v2 endpoint.
In order to read team member information, you will need to create an API app with team scopes — you can create an API app from your account's App Console. The scope needed, just to list team members, is: 'members.read'. Keep in mind that API apps with team scopes can only be approved by team admins only.
Below is a sample code snippet:
// Initialize with an admin-level team access token using var teamClient = new DropboxTeamClient("YOUR_TEAM_ADMIN_TOKEN"); var listResult = await teamClient.Team.MembersListV2Async(); while (true) { foreach (var member in listResult.Members) { Console.WriteLine($"ID: {member.Profile.TeamMemberId} | Email: {member.Profile.Email}"); } if (listResult.HasMore) { listResult = await teamClient.Team.MembersListContinueV2Async(listResult.Cursor); } else { break; } }
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,035 PostsLatest Activity: 2 years ago
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or 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!