Skip to main content
Question

Retrieving list of users and it's status via Python script

  • May 21, 2025
  • 2 replies
  • 37 views

Forum|alt.badge.img

Hi All,

I am an IT admin. I am trying to write a simple script that will list all users and its status. I see the oAuth token examples but you have to refresh the token every hour. Is there a way to use a service token that will allow me to query the list of users from a script without authentication ? 

2 replies

Forum|alt.badge.img

To get a list of Managed Users through the API, the recommended route is authenticating as the Box Admin using the OAuth process.

 

To test your script you can use the developer token generated through the developer console. For production use cases, you shouldn't use the developer token.


Forum|alt.badge.img

Hi,

 

I was told for a standalone app with screen (CLI) output you needed to use JWT w/OAuth but if you want a web output then just OAuth. But that a side there is almost no Python Boxsdk examples out there so it would have been nice if  you would have provided a Python code example(s) of how to authenticate and list user info.