Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
gagsbh80
7 years agoExplorer | Level 4
Dropbox Space Usage Differences
Hello Greg,
We have few Dropbox for Biz accounts whose Usage Size is shown in Admin Console screen. I used Dropbox API - GetSpaceUsageAsync of Dot Net SDK to obtain Space Usage programatically (us...
Greg-DB
Dropbox Community Moderator
7 years agoThanks for the post! I'll look into this and follow up here once I have some information for you.
Greg-DB
Dropbox Community Moderator
7 years agogagsbh80 Can you clarify which value you're looking at from the API? Please share the rest of the code you're using to process the result from GetSpaceUsageAsync if possible.
Note that there are multiple 'used' values returned in a SpaceUsage, e.g.:
- SpaceUsage.Used: the user's usage
- TeamSpaceAllocation.Used: the team's usage
- gagsbh807 years agoExplorer | Level 4
Hello Greg,
Thanks for the reply.
I am using the following API - SpaceUsage.Used and the following piece of code:
MembersListResult members = await teamclient.Team.MembersListAsync(margs);
foreach (Dropbox.Api.Team.TeamMemberInfo ti in members.Members)
{
DropboxClient clientadmin2 = teamclient.AsMember(ti.Profile.TeamMemberId);
Dropbox.Api.Users.SpaceUsage spaceusage = await clientadmin2.Users.GetSpaceUsageAsync();
mbr.Usage = Math.Round(((double)spaceusage.Used / 1024 / 1024), 2).ToString() + " MB";
....
....
}I tried TeamSpaceAllocation.Used after your reply. Please see code below:
Dropbox.Api.Users.SpaceAllocation.Team sp1 = spaceusage.Allocation.AsTeam;
Dropbox.Api.Users.TeamSpaceAllocation sp2 = sp1.Value; //returns 734686370
decimal spaceused = ((decimal)sp2.Used/ 1024 / 1024); //returns 700.65
spaceused = Math.Round(spaceused, 2);However, TeamSpaceAllocation.Used returns 734686370 bytes or 700.65 MB for every member in the for loop. This figure seems to be the total usage size of the team.
Thanks,
Gagan
- Greg-DB7 years ago
Dropbox Community Moderator
Thanks! I don't see an issue in that code, so please open a ticket and share the relevant account IDs so we can check on these:
- gagsbh807 years agoExplorer | Level 4
Hey Greg,
I had written to https://www.dropbox.com/developers/contact 2 weeks back with the e-mail ids but did not hear back.
Thanks,
Gagan
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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, Facebook or Instagram.
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!