box / box-python-sdk

Box SDK for Python
http://opensource.box.com/box-python-sdk/
Apache License 2.0
419 stars 215 forks source link

Support for Create Jobs to Terminate User Session API? #836

Closed tribloom closed 1 year ago

tribloom commented 1 year ago

Description of the Issue

When will the create jobs to terminate user session API (https://developer.box.com/reference/post-users-terminate-sessions/) be supported?

antusus commented 1 year ago

Hello @tribloom ,

so far we do not have or plan adding session termination to this SDK. However we do welcome contributions, if you would like to add it.

mgrytsai commented 1 year ago

hi @tribloom,

Though we don't have support for session termination API in the python SDK yet, but I just wanted to give a heads up that we've been working on a generation of SDK with full API support. And we are currently in a Public Beta. This new generation Python SDK is available and you could use that for Session termination API.

Here is a snippet how you could use that:

from box_sdk_gen.developer_token_auth import DeveloperTokenAuth
from box_sdk_gen.client import Client

def main(token: str):
    auth: DeveloperTokenAuth = DeveloperTokenAuth(token=token)
    client: Client = Client(auth=auth)

    # Session termination for User by UserId and UserLogin
    client.session_termination.create_user_terminate_session(['you user_ids'], [])
    # Session termination for Group by GroupId
    client.session_termination.create_group_terminate_session(["your group_ids"])

if __name__ == '__main__':
    main('your developer token here')

Click here to learn more about session termination in the SDK.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.

stale[bot] commented 1 year ago

This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box Python SDK and feel free to open another PR/issue at any time.