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

Get user id from email address

New post

Comments

7 comments

  • cbetta

    HI , I am not sure you actually need to. When you create a collaboration (adding a user to a folder) you can actually do so by email address (aka login in Box terms).

     

    https://developer.box.com/reference/post-collaborations#param-accessible_by-login

    0
    Comment actions Permalink
  • BAILANDO

    Hello,

    sorry for late response, i was on vacation.

     

    With this question i mean, if it's possible via API get userid from email address.

     

    For example, in RPA automation process user know email address ***email address removed for privacy*** and api return userid from this address. If i get user id then i can continue with process and creating invitation for user to specific folders.

    0
    Comment actions Permalink
  • cbetta

    Hi  , yes you can. 

     

    You can search for a user by login (email adress) using this API https://developer.box.com/reference/get-users/

     

    Just set the filter_term to the email address of the user, and the results will be a list of 0 or 1 users who match that email address.

     

    0
    Comment actions Permalink
  • hsabp

    I use the Box CLI to do this, pretty easy like this:

     

    box users --filter=$email
    0
    Comment actions Permalink
  • BAILANDO

    thank you all for help 🙂

    0
    Comment actions Permalink
  • BAILANDO

    Hello again, my last question. What scopes i need in my app to succesfully get list of enterprise users? i have application scope and manage users scope in standard oauth 2.0, but in our enviroment im not an admin. It's a problem?

     

    Thank you.

    0
    Comment actions Permalink
  • cbetta

     your app indeed needs Enterprise-level scope, and admin permissions. If you are not an admin, then the best way is to either get an admin to authorize the app with Oauth 2, or to use JWT with enterprise-level access. This last one will also require an admin to approve the app.

    0
    Comment actions Permalink

Please sign in to leave a comment.