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
swa22
2 years agoHelpful | Level 6
Not sure how to interpret /users/get_space_usage output for team account
Hello,
I get the following output from get_space_usage for a team account:
allocation = {
".tag" = team;
allocated = 9895604649984;
used = 7346077264133...
- 2 years ago
I need to make a self correction. Turns out the user has given me a wrong input on the problem. After a deeper investigation it has turned out that all numbers in his account are adding up correctly. I apologize for the mistake!
swa22
Helpful | Level 6
Thanks for the quick reply!
However, now I'm even more confused.
When I enumerate and calculate the total all files and folders of that user using /list_folder (and I DO use the
Dropbox-API-Path-Root and specify the user's root namespace ID) it's only like 0.7 TB, while according to you, the user is consuming around 6.6 TB.
Where are the rest of files then?
Regarding other users:
In that case, the space usage of the other members of the team can be calculated like allocation.used - used, correct? In this case it would be 7346077264133 - 7234056173955 = 112021090178 (0.1 TB). Is this correct?
Regarding the caching: I don't seem to understand what it even means. Would you please elaborate? Where the caching occurs and what for?
Thanks!
Здравко
2 years agoLegendary | Level 20
Hi again swa22,
You didn't mention exact steps you have used to receive your result in OP. That can be source of different confusion types. Take in mind that the result is context sensitive! Context - the current user as assigned by 'Dropbox-API-Select-User' header. Different users can have different access and in this context different parts of the entire business account can be seen.
swa22 wrote:..., the user is consuming around 6.6 TB.
...
No, the user, who's context is involved in the call of OP, uses ~6.5TB. 6.6TB is the space used by all members (including current user)! Take in mind that listing can show files/folders that engage other member' space (including admin owned). Did you use the same member context when you got to the information and when listed the content? 🤔... or maybe different member' contexts have been in use. 🧐😉
swa22 wrote:...
Regarding other users:
In that case, the space usage of the other members of the team can be calculated like allocation.used - used, correct? In this case it would be 7346077264133 - 7234056173955 = 112021090178 (0.1 TB). Is this correct?
...
Yes.
swa22 wrote:...
Regarding the caching: I don't seem to understand what it even means. Would you please elaborate? Where the caching occurs and what for?
...
To be honest, I don't understand why is this information provided and what it would be useful for. Let's hope Dropbox staff can clarify it... Monday. In my opinion such an info is useful internally only (load balancing on Dropbox servers), but I may be wrong.
- swa222 years agoHelpful | Level 6
> You didn't mention exact steps you have used to receive your result in OP. That can be source of different confusion types. Take in mind that the result is context sensitive! Context - the current user as assigned by 'Dropbox-API-Select-User' header. Different users can have different access and in this context different parts of the entire business account can be seen.
> Did you use the same member context when you got to the information and when listed the content? 🤔... or maybe different member' contexts have been in use. 🧐😉
I use the standard User API authentication ("Authorization: Bearer <OAUTH2_ACCESS_TOKEN>" header), I'm not using the "Dropbox-API-Select-User" header.
I'm accessing the API through a third-party app. After the user has authorized the app to access his Dropbox content, I obtain the refresh token and request an access token, which I pass to all subsequent requests to the API endpoitns.
I do pass the Dropbox-API-Path-Root header for the list_folder endpoint, but I don't pass the Dropbox-API-Path-Root header when I request the get_space_usage endpoint. Should I?
What I expect to achieve is that the user can see a breakdown of his space usage - how much space the team has in general, how much of that space is used by this particular user, and how the latter space is distributed between his files. The problem is however, that the total of all user's files is far below the number of his used space, and it's not clear where this space goes, and I cannot understand why and what I'm doing wrong.
> No, the user, who's context is involved in the call of OP, uses ~6.5TB. 6.6TB is the space used by all members (including current user)!
Well, the user's own used space is 7234056173955 B which is 6.57934 TB, and the space used by all members is 7346077264133 B, which is 6.68122 TB, so I guess we are talking about the same thing here.
> Take in mind that listing can show files/folders that engage other member' space (including admin owned).
Yes, I realize that because the listed user content can include shared folders from other users' accounts, the total of his files can appear GREATER than his actual used space figure. However, I'm observing the opposite situation - the total of his files is much LESS than his actual used space. How do we explain that?
- Greg-DB2 years agoDropbox Staff
swa22 Thanks for the post. We'll take a look and see if we can get some more clarity on this for you.
For reference, you do not need to set the 'Dropbox-API-Path-Root' header when calling /2/users/get_space_usage.
As for reconciling the output of get_space_usage with the totals you see when using list_folder, if that's not lining up for you, can you share the relevant code/steps to reproduce that so we can look at what may be going on?
- swa222 years agoHelpful | Level 6
Thanks for getting back to me.
Well, I guess my code is too long to fit into a forum post, but I have already outlined the essence of it.
I have my own app that connects to the Dropbox API (REST HTTP) on behalf of a user to build a breakdown of the user's usage of Dropbox space quota, by scanning all files and folders, calculating their total size, and building a sorted list.
The user in question is a regular user, not an admin / team owner.
On one hand, I query get_space_usage and obtain the overall used space for the team and for this particular user.
On the other hand, I send a sequence of list_folder requests to scan ALL files and folders and calculate their total size. For these requests, I include the Dropbox-API-Path-Root, including the "root" parameter equal to the "root_namespace_id" obtained from the previous get_current_account request. I'm sure the Dropbox-API-Path-Root is working, because after including it, I can see additional shared folders that weren't visible without the header.
However, even with the shared folders included, the outcome is that the total of all files and folders is significantly (order of magnitude) less than the user's own used space reported by get_space_usage.
My question is, how is it possible to explain this striking discrepancy, what are the possible scenarios? What could be using the rest of the used space? Why am I not able to scan it with list_folder?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,914 PostsLatest Activity: 2 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!