You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
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 (using following API).
DropboxClient clientadmin2 = teamclient.AsMember(ti.Profile.TeamMemberId);
Dropbox.Api.Users.SpaceUsage spaceusage = await clientadmin2.Users.GetSpaceUsageAsync();
Dave Minns - Admin
dminns@xyz.com
Admin Console : 11.19 MB
API Calculated : 21.91 MB (22977638 bytes)
Adam Stuflick
adam@xyz.com
Admin Console : 48.93 MB
API Calculated: 50.76 MB (53226491 bytes)
DEMO Dropbox-Account
dsclient@xyz.net
Admin Console : 9.11 MB
API Calculated: 9.13 MB (9573449 bytes)
Gagan Bhatnagar
gagan@xyz.com
Admin Console : 12.86 MB
API Calculated : 14.71 MB (15421481 bytes)
The Space Usage of most of the Dropbox for Biz accounts obatined via API and on Admin Console screen differs.
For some of the accounts like Dave Minns - Admin, the Space Usage on Admin Console is 11.19 MB whereas API Calculated is 21.91 MB.
Can you help me understand why are we seeing such a difference and what can I do to obtain the correct values using API as shown in Admin console screen.
Thanks,
Gagan
- Greg-DBDropbox Staff
Thanks for the post! I'll look into this and follow up here once I have some information for you.
- Greg-DBDropbox Staff
gagsbh80 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
- gagsbh80Explorer | 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
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,915 PostsLatest Activity: 6 hours agoIf 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!