Skip to main content

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}"')

Be the first to reply!

Reply