cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Musicians, convert your MuseScore files to PDF to play music on the go! Learn more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Python SDK Set Custom Quota

Python SDK Set Custom Quota

JohnAdam_CUNY
Helpful | Level 6

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 2

Здравко
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.

Greg-DB
Dropbox 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)

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?