with user login find boxid using Python API
AnsweredI have a lists of PrimarySMTPAddresses of box users I want to archive and disable. How to I get their boxids, knowing only their login
Is there something like the following?
this_user =client.user(login=primaryAddress).get()
userboxid = this_user.boxid
so I can do things like this.....
this_user = client.user(box_id).get()
(this_user.status != 'inactive'):
deactivated_user = deactivate_this_user.update_info({'status': 'inactive'})
-
Official comment
You'll want to get all enterprise users and filter on the login field, which is the given email address. This will give you the user ID back.
Comment actions -
Can you please send some example code?
A few lines would probably be sufficient. How do I search all enterprise users and then just filter on a specific login id?
Is there a search call?
Yes, I have made a userDict before in python and gotten boxid by login.....but I would rather make one call with the method to search and filter than build all the 55thousand users into a dictionary.
-
users = client.users(filter_term='example@boxdemo.com')
for user in users:
print('{0} (User ID: {1})'.format(user.name, user.id))
Please sign in to leave a comment.
Comments
3 comments