cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Tell us what you want to see on the Community 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: 

Dropbox Space Usage Differences

Highlighted

Dropbox Space Usage Differences

Explorer | Level 3

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

8 Replies 8
Highlighted

Re: Dropbox Space Usage Differences

Dropboxer

Thanks for the post! I'll look into this and follow up here once I have some information for you.

Highlighted

Re: Dropbox Space Usage Differences

Dropboxer

@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.:

 

Highlighted

Re: Dropbox Space Usage Differences

Explorer | Level 3

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

Highlighted

Re: Dropbox Space Usage Differences

Dropboxer

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:

https://www.dropbox.com/developers/contact 

Highlighted

Re: Dropbox Space Usage Differences

Explorer | Level 3

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

 

Highlighted

Re: Dropbox Space Usage Differences

Dropboxer

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

Highlighted

Re: Dropbox Space Usage Differences

Dropboxer

We've added a new field to TeamSpaceAllocation named 'user_within_team_space_used_cached' that should match the value reported on the Dropbox web site.

This is currently available in the API, and should be available in the next release of each of the official SDKs.

Highlighted

Re: Dropbox Space Usage Differences

Explorer | Level 4

Thanks Greg,

This new fields helped us get the correct value.

Gagan

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?