Skip to main content
Question

with user login find boxid using Python API

  • May 22, 2025
  • 3 replies
  • 4 views

Forum|alt.badge.img

I 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'})

 

 

3 replies

Forum|alt.badge.img

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.

 

 


Forum|alt.badge.img

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.


Forum|alt.badge.img

users = client.users(filter_term='example@boxdemo.com')
for user in users:
     print('{0} (User ID: {1})'.format(user.name, user.id))