Change Folder Ownership
/documents/api/1.2/folders/{folderId}/changeOwnership
Change the ownership of a specified folder and gives the requester Manager access to the specified folder.
Note:
To change the ownership of a folder, the requester must have admin privileges for the folder. That is, the requester must be the owner or have the manager role.
Request
- application/json
- application/xml
-
folderId: string
Globally unique identifier (GUID) for the folder to change.
The request body defines details of the change ownership of the folder request. All parameters are required.
object
The request body defines details of the change ownership of the folder request. All parameters are required.
-
targetUserID:
string
(Required) Specify the globally unique identifier (GUID) or the login name of the new owner of the folder.
{
"targetUserID":"cecsadminb"
}
Response
- application/json
- application/xml
200 Response
The request was fulfilled.
object
-
errorCode(optional):
string
An error code of zero (0) indicates no errors.
-
id(optional):
string
Globally unique identifier (GUID) of the folder that was changed.
-
targetUserID(optional):
string
Globally unique identifier (GUID) or the login name of the new owner of the folder.
-
type(optional):
string
Item type
folder
.
{
"targetUserID":"cecsadminb",
"id":"FC6FB38E75C284E70934F6221B1E5B8F7FDF5701EE84",
"type":"folder",
"errorCode":"0"
}
400 Response
Request parameters are not formatted correctly.
403 Response
Forbidden if the user does not have read permission.
404 Response
Folder ID is not found.
Examples
Example 1
The following example changes the ownership of the folder id FB47F0210E3ED563650E2A1C2B885A869C3D3E4453A5 to the user ID U50736B544D00DF1EED770AC72F1B43EEA1F and shares the folder to the requester.
POST ...folders/FB47F0210E3ED563650E2A1C2B885A869C3D3E4453A5/changeOwnership
Request Header
None.
Request Body
{ "targetUserID":"U50736B544D00DF1EED770AC72F1B43EEA1F" }
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "errorCode": "0", "id": "FB47F0210E3ED563650E2A1C2B885A869C3D3E4453A5", "targetUserID": "U50736B544D00DF1EED770AC72F1B43EEA1F", "type": "folder" }