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

Delete deactivated users via API call

New post

Comments

2 comments

  • jcleblanc

    Hi @KobiVaknin,

     

    You'll want to use JWT auth with enterprise access if you are monitoring / deleting users for an enterprise. Here's a guide on setting that up with the different configuration options. Here's a sample on how to delete a user with the different SDKs.

     

    Thanks,

    Jon

    0
    Comment actions Permalink
  • KobiVaknin
    So the request should be like this?
    Thanks!
     
    from boxsdk import JWTAuth
    import requests
    import json
    from boxsdk import Client
     
    config = JWTAuth.from_settings_file("<file_path>\\config.json")
    client = Client(config)
     
    users = client.users(user_type='managed')
    for user in users:
      if user.status == 'inactive':
        print('User Login: {1}'.format(user.login))
    0
    Comment actions Permalink

Please sign in to leave a comment.