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

Number of seats?

Answered
New post

Comments

2 comments

  • LoCortes

    Hello ,

     

    I think that there's nothing available on that sense.

     

    There are some functionalities that are not on the API and would be nice to have them such as number of users, number of files owned by a user, number of documents in a folder... 

     

    All those elements are needed if you wanna ensure a good management of your limits, being license limits or performance ones. Still not available though.

     

    Thanks

     

     

    0
    Comment actions Permalink
  • rvandolson

    Found a way to do this thanks to an answer on Stackoverflow.

     

    Extended the Box SDK's client class as follows:

     

    def num_users(self):
            """Return the number of active users.  We essentially make a users
            call, but limit the number of users returned to 1 and extract the
            total_count information from the payload.
            
            Returns:
            An integer representing the number of users.
            """
    
            url = '{0}/users'.format(API.BASE_API_URL)
            params = dict(limit=1)
            box_response = self._session.get(url, params=params)
    
            return box_response.json()['total_count']

     

    0
    Comment actions Permalink

Please sign in to leave a comment.