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 (us...
Greg-DB
Dropbox 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
gagsbh80
7 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 agoDropbox Staff
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
- Greg-DB7 years agoDropbox Staff
gagsbh80 Thanks for following up. I did reply to your ticket later that day, but it sounds like that response didn't make it to you unfortunately. (Perhaps it went to your spam folder?)
In any case, I can confirm that the web site and API are calculating these values differently (mainly due to differences in how we're counting space from shared folders). I'll let you know when I have an update on that.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,917 PostsLatest Activity: 20 minutes ago
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!