Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
swa22
3 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...
- 3 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
3 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-DB
Dropbox Community Moderator
3 years agoswa22 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?
- swa223 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?
- Greg-DB3 years ago
Dropbox Community Moderator
swa22 Thanks for the additional information. I'll check in with the team on this.
- swa223 years agoHelpful | Level 6
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!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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!