How to get Owner's collaboration ID through Box API

Répondu
New post

Commentaires

3 commentaires

  • Jennie Fitz

    To transfer folders from one user to another using the Collaboration Transfer Method in Box, and to address the issue of not being able to get the Owner collaboration ID through the “get collaboration endpoint,” you can try the following steps:

    Use the Transfer Owned Folders API:
    Instead of relying on the collaboration ID, you can use the transferOwnedFolder endpoint, which is designed to move all content from one user directly to another. This method does not require fetching the collaboration ID.
    Here’s an example of AarpMembership how to use this endpoint:
    Python

    import boxsdk

    client = boxsdk.Client('YOUR_ACCESS_TOKEN')
    source_user_id = 'SOURCE_USER_ID'
    destination_user_id = 'DESTINATION_USER_ID'

    source_user = client.user(source_user_id)
    destination_user = client.user(destination_user_id)

    folder = source_user.transfer_content(destination_user)
    print(f'Transferred folder to user {destination_user.id}')
    AI-generated code. Review and use carefully. More info on FAQ.
    Promote Co-Owner to Owner:
    If you need to change the ownership of a specific folder, you can promote the Co-Owner to Owner. This involves:
    Adding the new owner as a Co-Owner.
    Promoting the Co-Owner to Owner.
    Re-fetching the collaboration list to locate the previous owner

    0
    Actions pour les commentaires Permalien
  • Rona

    Hi there,

    Welcome to Box Community and glad to assist!

    It shows that you have a designated team that works with Box Premier Services.

    For immediate assistance, you should contact your internal helpdesk team.

    Thanks for posting! 

    0
    Actions pour les commentaires Permalien
  • Yu Bin Mao

    Hi Jennie,

    As you suggested, I can get the original Owner user 's collaboration ID after promoting another user to Owner. But it seems that the user collaboration ID does not work after I recover the original Owner user to Owner.
    I use this  Box SDK java code and it will throw " not_found - Not Found " Error.
    BoxCollaboration co = new BoxCollaboration(api,"XXXXXXXX");

    I wonder if that is because the collaboration ID will be set to NULL when the user role is Owner.  Or there is any other way to get the Owner's collaboration ID directly?

    Thanks.

    0
    Actions pour les commentaires Permalien

Vous devez vous connecter pour laisser un commentaire.