Change Folder Ownership

post

/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

Supported Media Types
Path Parameters
Body ()

The request body defines details of the change ownership of the folder request. All parameters are required.

Root Schema : FolderChangeOwnershipBody
Type: object

The request body defines details of the change ownership of the folder request. All parameters are required.

Show Source
  • (Required) Specify the globally unique identifier (GUID) or the login name of the new owner of the folder.
Example Request (application/json)
{
    "targetUserID":"cecsadminb"
}
Back to Top

Response

Supported Media Types

200 Response

The request was fulfilled.

Body ()
Root Schema : FolderChangeOwnershipResponse
Type: object
The response body includes information about the change ownership of the folder.
Show Source
Example Response (application/json)
{
    "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.

Back to Top

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"
}
Back to Top