Delete Folder
/documents/api/1.2/folders/{folderId}
Delete the specified folder.
Request
- application/json
- application/xml
-
folderId: string
Globally unique identifier (GUID) for the folder.
-
accessToken(optional): 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(optional): string
Applink ID authorizing the current user to access this folder. Any time the parameter
appLinkID
is used, a parameteraccessToken
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(optional): 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(optional): 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.
Response
- application/json
- application/xml
200 Response
The request was fulfilled.
object
-
errorCode(optional):
string
An error code of zero (0) indicates no errors.
-
idList(optional):
string
Globally unique identifier (GUID) of the deleted folder.
-
type(optional):
string
Item type
folder
.
{
"idList":"F01C3C4622C7031AD5B69F19T0000000000100000001",
"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
The following example deletes the specified folder and its contents.
DELETE .../folders/F01C3C4622C7031AD5B69F19T0000000000100000001
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "errorCode": "0", "idList": "F01C3C4622C7031AD5B69F19T0000000000100000001", "type": "folder" }
Example 2
The following example deletes the specified folder and its contents. The example uses a public link ID because this folder is under a folder structure not owned by or shared with the current user.
DELETE .../folders/F140C834BF9484B69B26383AB5D17B95F47087F4E518
Request Header
LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "errorCode": "0", "idList": "F140C834BF9484B69B26383AB5D17B95F47087F4E518", "type": "folder" }
Example 3
The following example deletes the specified folder and its contents. The example uses an access code protected a public link ID 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.
DELETE .../folders/F140C834BF9484B69B26383AB5D17B95F47087F4E518
Request Header
LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518 Cookie: dAccessCode-LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518=test12345
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "errorCode": "0", "idList": "F140C834BF9484B69B26383AB5D17B95F47087F4E518", "type": "folder" }
Example 4
The following example requests deletion of the specified folder and its contents. Because this folder is under a folder structure not owned by or shared with the current user, an access denied error message is returned.
DELETE .../folders/F140C834BF9484B69B26383AB5D17B95F47087F4E518
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 403
JSON Response
{ "errorCode": "-20", "errorKey": "!csFldUnableToDeleteItems!csCloudItemInsufficientPrivileges,User BB,fFolderGUID:F140C834BF9484B69B26383AB5D17B95F47087F4E518,FLD_MOVE_TO_TRASH", "errorMessage": "Unable to delete items. User 'User BB' has insufficient privilege to access fFolderGUID:F140C834BF9484B69B26383AB5D17B95F47087F4E518 with service FLD_MOVE_TO_TRASH.", "errorType": "folder", "idList": "F140C834BF9484B69B26383AB5D17B95F47087F4E518", "title": "Unable to delete items. User 'User BB' has insufficient privilege to access fFolderGUID:F140C834BF9484B69B26383AB5D17B95F47087F4E518 with service FLD_MOVE_TO_TRASH.", "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" }
Example 5
The following example requests deletion of the specified folder and its contents. 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.
DELETE .../folders/F140C834BF9484B69B26383AB5D17B95F47087F4E518
Request Header
LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518
Request Body
None.
HTTP Status Code
HTTP_STATUS = 403
JSON Response
{ "errorCode": "-18", "errorKey": "!csFldUnableToDeleteItems!csAccessCodeRequiredForLinkAccess", "errorMessage": "Unable to delete items. The access code must be provided to access the link.", "errorType": "folder", "idList": "F140C834BF9484B69B26383AB5D17B95F47087F4E518", "title": "Unable to delete items. 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 deletes the specified folder and its contents. 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.
DELETE .../folders/F4927423081AA3C261E1D45AB5D17B95F47087F4E518
Request Header
appLinkID: LF5Bxj4TPo_p4n4qWn0tbKTicR2cTUJKv7X_ng9E7ry93rRuDokPqS1d6-wKwhb_wtcGYFDsI_cNMxeKQ-HR-FXQhiVoGRTYM_MPZY8qpICfYU94mmnMjM_cvsRhKMzc0NJgvwEJfqqDwPsAVrhc8cmg== accessToken: 352FpiMmW66PeYI1Gh5b83I9CXRwZhLfYAu4TXdqpzD8uNKUBMZVVJ3ZvivUW8kQ
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "errorCode": "0", "idList": "F4927423081AA3C261E1D45AB5D17B95F47087F4E518", "type": "folder" }