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
JohnAdam_CUNY
3 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}")
- Greg-DBDropbox Staff
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)
- ЗдравкоLegendary | 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.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,883 PostsLatest Activity: 7 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!