Skip to main content

Good afternoon,

Hope everyone was able to catch Boxworks today.

Is there an easy way to utilize List enterprise users from the API to populate a user MetaData collection?

The idea is that the users exist in Box and having to manually add users to the metadata collection is inefficient. 

 

Thanks in advance,

Rob

Hi Rob,

 

Not sure what you mean by a user metadata collection…

 

You can certainly use the List enterprise users end point (GET https://api.box.com/2.0/users). This however requires your app scopes to include “Manage Users” .

 

Can you elaborated on User metadata collection?


We have been working on some apps for our HR department where it is necessary to include a picklist of users. The user data will be included in Metadata  template that will be used for processing HR forms.

Instead of populating the pick list in the metadata every time we add/delete a user it would be ideal if the list of users was automatically populated from the list of box users.

I hope this helps explain.

Thanks 


Hi Rob,

Thank you for the clarification, it does help.

Assuming that the HR users is a very specific list, I think the “List enterprise users” endpoint might not be ideal, as this endpoint has very limited search capabilities :

filter_term (string in query optional)

Limits the results to only users who's name or login start with the search term.

For externally managed users, the search term needs to completely match the in order to find the user, and it will only return one user at a time.

Even combined with:

user_type (string in query optional)

Limits the results to the kind of user specified.

all - returns every kind of user for whom the login or name partially matches the filter_term. It will only return an external user if the login matches the filter_term completely, and in that case it will only return that user.

managed - returns all managed and app users for whom the login or name partially matches the filter_term.

external - returns all external users for whom the login matches the filter_term exactly.

However I’m thinking if using Groups help in this situation.

If you create a Group containing the relevant HR users, then you should be able to query the users of just that Group, using the Get group membership endpoint/SDK

This way the list of users is maintained at group level, 

Please note that only admins of the group or users with admin-level permissions will be able to use this API.

 

Let me know if this helps