Edit Folder

put

/documents/api/1.1/folders/{folderId}

Change the name or the description of the specified folder.

Request

Supported Media Types
  • application/json
  • application/xml
Path Parameters
folderId
Type: string
Required: true

Globally unique identifier (GUID) for the folder.

Header Parameters
accessToken
Type: string

Applink access token authorizing the current user to access this folder. This parameter is mandatory if appLinkID is used. It can be used as accessToken or AccessToken.

appLinkID
Type: string

Applink ID authorizing the current user to access this folder. Any time the parameter appLinkID is used, a parameter accessToken must be provided as well. To work, this applink must have at least the contributor role granted. It can be used as appLinkID or AppLinkID.

dAccessCode
Type: string

Access code needed to use protected public links. It needs to be sent as part of a Cookie header in the following format: dAccessCode-<linkID>=<passcodeValue>

linkID
Type: string

Public link ID of a public link authorizing the current user to access this folder. To work, this public link must have the contributor role granted. It can be used as linkID or LinkID.

Body Parameter
The request body defines details of the edit folder request. There are no required attributes.
Root Schema : FolderEditBody
The request body defines details of the edit folder request. There are no required attributes.
Example application/json

{
    "name":"backup",
    "description":"my backup folder"
}

Response

Supported Media Types
  • application/json
  • application/xml
200 Response

The request was fulfilled.

Body
The response body includes information about the folder.
Root Schema : FolderResponse
Type: object
The response body includes information about the folder.
Nested Schema : FolderDefinition
Folder metadata information.
Nested Schema : User
User information
Example application/json

{
    "id":"F512DA3911603E8AB84A07ACT0000000000100000001",
    "parentID":"FF4729683CD68C1AFB1AE87DT0000000000100000001",
    "name":"backup",
    "description":"my backup folder",
    "type":"folder",
    "size":"0",
    "childItemsCount":"0",
    "createdTime":"2014-02-21T20:56:07Z",
    "modifiedTime":"2014-02-21T20:59:57Z",
    "createdBy":{
        "id":"U0EAA20910FAF3052ACB79E4T00000000001",
        "displayName":"User AA",
        "type":"user"
    },
    "ownedBy":{
        "id":"U0EAA20910FAF3052ACB79E4T00000000001",
        "displayName":"User AA",
        "type":"user"
    },
    "modifiedBy":{
        "id":"U0EAA20910FAF3052ACB79E4T00000000001",
        "displayName":"User AA",
        "type":"user"
    },
    "errorCode":"0"
}
400 Response

Request parameters are not formatted correctly.

403 Response

Forbidden if the user does not have write permission.

404 Response

Folder ID is not found.

Examples

The following example changes the name of the specified folder.

PUT .../folders/F512DA3911603E8AB84A07ACT0000000000100000001

Request Header

None.

Request Body

{
    "name": "backup",
    "description": "my backup folder"
}

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "childItemsCount": "0",
    "createdBy": {
        "displayName": "User AA",
        "id": "U0EAA20910FAF3052ACB79E4T00000000001",
        "type": "user"
    },
    "createdTime": "2014-02-21T20:56:07Z",
    "description": "my backup folder",
    "errorCode": "0",
    "id": "F512DA3911603E8AB84A07ACT0000000000100000001",
    "modifiedBy": {
        "displayName": "User AA",
        "id": "U0EAA20910FAF3052ACB79E4T00000000001",
        "type": "user"
    },
    "modifiedTime": "2014-02-21T20:59:57Z",
    "name": "backup",
    "ownedBy": {
        "displayName": "User AA",
        "id": "U0EAA20910FAF3052ACB79E4T00000000001",
        "type": "user"
    },
    "parentID": "FF4729683CD68C1AFB1AE87DT0000000000100000001",
    "size": "0",
    "type": "folder"
}

Example 2

The following example changes the name and description of the specified folder. The example uses a public link ID because this folder is under a folder structure not owned by or shared with the current user.

PUT .../folders/F81175D40FF57F19884AED0CB5D17B95F47087F4E518

Request Header

LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518

Request Body

{
    "name": "UserBBFolderUpdated",
    "description": "User BB folder created via public link - updated"
}

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "childItemsCount": "0",
    "createdBy": {
        "displayName": "User BB",
        "id": "U6A0B35B0548F250914D18FDB5D17B95F470",
        "type": "user"
    },
    "createdTime": "2016-06-30T23:34:21Z",
    "description": "User BB folder created via public link - updated",
    "errorCode": "0",
    "id": "F81175D40FF57F19884AED0CB5D17B95F47087F4E518",
    "modifiedBy": {
        "displayName": "User BB",
        "id": "U6A0B35B0548F250914D18FDB5D17B95F470",
        "type": "user"
    },
    "modifiedTime": "2016-06-30T23:42:44Z",
    "name": "UserBBFolderUpdated",
    "ownedBy": {
        "displayName": "User AA",
        "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
        "type": "user"
    },
    "parentID": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
    "size": "0",
    "type": "folder"
}

Example 3

The following example changes the name and description of the specified folder. The example uses a public link ID protected by an access code because this folder is under a folder structure not owned by or shared with the current user. An access code (test12345) is submitted as part of a Cookie in the request header.

PUT .../folders/F81175D40FF57F19884AED0CB5D17B95F47087F4E518

Request Header

LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518
Cookie: dAccessCode-LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518=test12345

Request Body

{
    "name": "UserBBFolderUpdated",
    "description": "User BB folder created via public link - updated"
}

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "childItemsCount": "0",
    "createdBy": {
        "displayName": "User BB",
        "id": "U6A0B35B0548F250914D18FDB5D17B95F470",
        "type": "user"
    },
    "createdTime": "2016-06-30T23:34:21Z",
    "description": "User BB folder created via public link - updated",
    "errorCode": "0",
    "id": "F81175D40FF57F19884AED0CB5D17B95F47087F4E518",
    "modifiedBy": {
        "displayName": "User BB",
        "id": "U6A0B35B0548F250914D18FDB5D17B95F470",
        "type": "user"
    },
    "modifiedTime": "2016-06-30T23:42:44Z",
    "name": "UserBBFolderUpdated",
    "ownedBy": {
        "displayName": "User AA",
        "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
        "type": "user"
    },
    "parentID": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
    "size": "0",
    "type": "folder"
}

Example 4

The following example requests a name and description update for the specified folder. Because this folder is under a folder structure not owned by or shared with the current user, an access denied error message is returned.

PUT .../folders/F81175D40FF57F19884AED0CB5D17B95F47087F4E518

Request Header

None.

Request Body

{
    "name": "UserBBFolderUpdated",
    "description": "User BB folder created via public link - updated"
}

HTTP Status Code

HTTP_STATUS = 403

JSON Response

{
    "description": "User BB folder created via public link - updated",
    "errorCode": "-20",
    "errorKey": "!csFldUnableToEditFolder!csCloudItemInsufficientPrivileges,User BB,fFolderGUID:F81175D40FF57F19884AED0CB5D17B95F47087F4E518,FLD_EDIT_FOLDER",
    "errorMessage": "Unable to edit folder. User 'User BB' has insufficient privilege to access fFolderGUID:F81175D40FF57F19884AED0CB5D17B95F47087F4E518 with service FLD_EDIT_FOLDER.",
    "errorType": "folder",
    "id": "F81175D40FF57F19884AED0CB5D17B95F47087F4E518",
    "name": "UserBBFolderUpdated",
    "title": "Unable to edit folder. User 'User BB' has insufficient privilege to access fFolderGUID:F81175D40FF57F19884AED0CB5D17B95F47087F4E518 with service FLD_EDIT_FOLDER.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}

Example 5

The following example requests a name and description update for the specified folder. This folder is under a folder structure not owned by or shared with the current user, and only a public link protected by an access code is available. An error is returned because the access code was not submitted as part of the request.

PUT .../folders/F81175D40FF57F19884AED0CB5D17B95F47087F4E518

Request Header

LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518

Request Body

{
    "name": "UserBBFolderUpdated",
    "description": "User BB folder created via public link - updated"
}

HTTP Status Code

HTTP_STATUS = 403

JSON Response

{
    "description": "User BB folder created via public link - updated",
    "errorCode": "-18",
    "errorKey": "!csFldUnableToEditFolder!csAccessCodeRequiredForLinkAccess",
    "errorMessage": "Unable to edit folder. The access code must be provided to access the link.",
    "errorType": "folder",
    "id": "F81175D40FF57F19884AED0CB5D17B95F47087F4E518",
    "name": "UserBBFolderUpdated",
    "title": "Unable to edit folder. The access code must be provided to access the link.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}

Example 6

The following example changes the description of the specified folder. The example uses an applink because this folder is under a folder structure not owned by or shared with the current user. The applink ID and access token are submitted in the request header.

PUT .../folders/FAA7449732E312E8174731B3B5D17B95F47087F4E518

Request Header

appLinkID: LF5Bxj4TPo_p4n4qWn0tbKTicR2cTUJKv7X_ng9E7ry93rRuDokPqS1d6-wKwhb_wtcGYFDsI_cNMxeKQ-HR-FXQhiVoGRTYM_MPZY8qpICfYU94mmnMjM_cvsRhKMzc0NJgvwEJfqqDwPsAVrhc8cmg==
accessToken: 352FpiMmW66PeYI1Gh5b83I9CXRwZhLfYAu4TXdqpzD8uNKUBMZVVJ3ZvivUW8kQ

Request Body

{
    "description": "subFolderTestByUserB CONTRIBUTOR applink - EDITED"
}

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "childItemsCount": "0",
    "createdBy": {
        "displayName": "User BB",
        "id": "U5083EA1954687218BA6C3D9B5D17B95F470",
        "type": "user"
    },
    "createdTime": "2017-06-21T18:53:43Z",
    "description": "subFolderTestByUserB CONTRIBUTOR applink - EDITED",
    "errorCode": "0",
    "id": "FAA7449732E312E8174731B3B5D17B95F47087F4E518",
    "modifiedBy": {
        "displayName": "User BB",
        "id": "U5083EA1954687218BA6C3D9B5D17B95F470",
        "type": "user"
    },
    "modifiedTime": "2017-06-21T19:09:25Z",
    "name": "subFolderTestByUserB",
    "ownedBy": {
        "displayName": "User AA",
        "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
        "type": "user"
    },
    "parentID": "F9681146B0BAAB329B58D6CFB5D17B95F47087F4E518",
    "size": "0",
    "type": "folder"
}