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

Highlighted
New Contributor

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

Hi All,

We have a need where we need to transfer some shared folder to another active user. I looked at the API ref doc but could not find the rest call for this.

Can someone please point me to right doc if there is one regarding this ? If not what are the options available?

 

Thanks

MCBSR

3 REPLIES 3
Highlighted
New Contributor

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

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

Highlighted
Box Employee

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

@BoxMCBSR 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.

Highlighted
First-time Contributor

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

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?