Delete deactivated users via API call
Hi :)
I need help to create API call that delete users when their status is "Deactivate".
Which authentication method should i use?
Can you show me an example script?
*I'm using Python
Thanks!
-
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
-
So the request should be like this?Thanks!from boxsdk import JWTAuthimport requestsimport jsonfrom boxsdk import Clientconfig = 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))
サインインしてコメントを残してください。
コメント
2件のコメント