Skip to main content
Question

BOX Windows SDK c# Getting A Users ID

  • May 22, 2025
  • 3 replies
  • 29 views

Forum|alt.badge.img

Hi,  first post so please be kind...  I'm building a Windows BOX App using the Windows SDK in C#.  I'm trying to add a user who I know has a BOX account to a folder but I'm unable to get their User ID.

 

My code: [i'm just trying to write their details to a richtextbox for testing]

 

BoxCollection workusers = await client.UsersManager.GetEnterpriseUsersAsync("***email address removed for privacy***");
            
            foreach (BoxUser workUser in workusers.Entries)
            {
                rtbMe.Text += workUser.Name.ToString() + Environment.NewLine + workUser.Login.ToString() + Environment.NewLine + workUser.Id.ToString();
            }
 
This doesn't return anything.  Is it possible to find any BOX User by typing their email address?
 
If I hard-code their User ID when giving folder permissions it adds them okay, but I need a way to query an email address to return their User ID rather than going to the web and manually noting it down..
 
Please help!
 
Thanks,
Gareth

3 replies

Forum|alt.badge.img

Hi  

 

Is there administrator authority for the enterprise with server authentication using JWT?
Isn't it impossible to get information because you don't have permission?


Forum|alt.badge.img

  I think   is correct. The get enterprise users endpoint can only be used by admins or co-admins with proper permissions. If a response isn't returned that's likely the cause. What user is associated with your token? 


Forum|alt.badge.img

thanks for the replies.

turns out I was being very silly.