Is there a API to transfer ownership of folder(s) to another active users ?

New post

Comments

4 comments

  • BoxMCBSR

    Just want to add that we want to do this programmatically. 

    0
    Comment actions Permalink
  • Murtza

     Depending on the specific scenario it might require more than one API call. I'll walk through an example. 

     

    Let's say user A owns folder 1 currently, and you want to move folder 1 within user B's folder 2. However, user A doesn't have access to user B's folder 2. To do this, user A has to be added as collaborator to folder 2 before you can do the move. This is because user A has to have access to that folder to add content to it. If you don't add user A as collaborator beforehand, you get 403 error. Once user A has access to user B's folder 2, you can move the folder and change the owners.

     

    Here are the API calls required for the scenario described above.

    0
    Comment actions Permalink
  • mitch-leblanc

    Following this simply page: https://developer.box.com/guides/folders/single/change-owner/

     

    I was able to transfer ownership from user A (current owner) to user B by simply:

     

    1. Get a user-client for user A
    2. Add a "collaboration" on the folder with user B as EDITOR
    3. Now update that collaboration to role "OWNER"

    Done, it's that easy.


    If you want, you can now delete the collaboration on the folder for user A, (which will now be listed as an Editor instead of the Owner.)

     

    I'm didn't have to do any "moving" at all, per the previous response, unless perhaps you were moving folders that were not in the roots of both users?

    0
    Comment actions Permalink
  • Sandbox Amay Kulkarni

    Hi Mitch,

    will it transfer all folder owner to user b, or only root folder?

    0
    Comment actions Permalink

Please sign in to leave a comment.