We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
JohnAdam_CUNY
11 months agoHelpful | Level 6
Python SDK Set Custom Quota
We have working version of our code using Python SDK but having trouble testing. What do I put for 20GB of data for custom_quota
Just want to confirm do I put 20 or 20 * 1024 * 1024 * 1024 for custom_quota and can I user user email instead of member_id
try:
response = dbx.team_member_space_limits_set_custom_quota( member_id=team_member_id, quota=custom_quota )
except:
dropbox.exceptions.ApiError as e: print(f"API Error: {e}")
2 Replies
- Здравко11 months agoLegendary | Level 20
Hi JohnAdam_CUNY,
First of all, you have to provide list, even for a single member - list of UserCustomQuotaArg. As could be seen there, value is in GB (just keep in mind that it's not entirely true - Dropbox uses GiB and similar units everywhere - including API).
By the way "20 * 1024 * 1024 * 1024" are 20GiB, not 20GB! "20 * 1000 * 1000 * 1000" are 20GB. Don't get confused. 🙂
To select some user, you may use all that UserSelectorArg provides.
Hope this helps.
- Greg-DB11 months ago
Dropbox Community Moderator
JohnAdam_CUNY Здравко is correct. For more information on using team_member_space_limits_set_custom_quota, please refer to the documentation.
So, for example, setting a custom quota for a single member by specifying an email address would look like:
users_and_quotas = [dropbox.team.UserCustomQuotaArg(user=dropbox.team.UserSelectorArg.email("user@example.com"), quota_gb=20)] response = dbx.team_member_space_limits_set_custom_quota(users_and_quotas=users_and_quotas)
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 9 months ago
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 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!