We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

JohnAdam_CUNY's avatar
JohnAdam_CUNY
Helpful | Level 6
3 months ago

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-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox 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)

     

  • 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

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 12 months ago
325 Following

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!