Skip to main content
Question

python code for "Create collaboration" in the Box API. Specifying a collaboration by email address.


Forum|alt.badge.img

Hello, this is Nobuhiro Yane.

I have a question about the python code for "Create collaboration" in the Box API.

The API reference says, "Collaborations can be created using email addresses, user IDs, or group IDs."

However, there was no example of specifying an email address in the python request example.

How should I modify the example below?

Does anyone know? Thank you.

(Example of request)

from boxsdk.object.collaboration import CollaborationRole

user = client.user(user_id='11111')

collaboration = client.folder(folder_id='22222').collaborate(user, CollaborationRole.VIEWER) collaborator = collaboration.accessible_by

item = collaboration.item

has_accepted = 'has' if collaboration.status == 'accepted' else 'has not' print(f'{collaborator.name} {has_accepted} accepted the collaboration to folder "{item.name}"')

0 replies

Be the first to reply!

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings