Welcome to the new Box Support website. Check out all the details here on what’s changed.

with user login find boxid using Python API

Answered
New post

Comments

3 comments

  • Official comment
    Kourtney

    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 Permalink
  • PEGGY DUFFY

    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.

    0
    Comment actions Permalink
  • Kourtney

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

    0
    Comment actions Permalink

Please sign in to leave a comment.