Delete a Collection
/documents/api/1.1/collections/{collectionId}
Delete the specified collection.
Request
- application/json
- application/xml
- collectionId
-
Type:
stringRequired:trueGlobally unique identifier (GUID) for the collection.
Response
- application/json
- application/xml
The request was fulfilled.
- errorCode
-
Type:
stringAn error code of zero (0) indicates no errors. - idList
-
Type:
stringThe collection Id. - type
-
Type:
stringItem typecollection.
Example application/json
{
"errorCode":"0",
"idList":"F79BD107FC398ED6FB482274T0000DEFAULT00000000",
"type":"collection"
}
Request parameters are not formatted correctly.
User does not have rights to the specified collection.
Collection is in the trash or is not found.
Examples
The following example deletes a collection.
DELETE .../collections/FEFFA68839EB0B144EDCD29545B3E9DD649055F5640B
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{
"errorCode": "0",
"idList": "FEFFA68839EB0B144EDCD29545B3E9DD649055F5640B",
"type": "collection"
}
Example 2
The following example doesn’t delete a collection because the collection specified is in the user's trash.
DELETE ...collections/F8BDBD5812C1C10E3E5C1A1C45B3E9DD649028853801
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 404
JSON Response
{
"errorCode": "-1",
"errorKey": "!csFldUnableToDeleteItems!csFldSourceInDestination,ATTRestCollection,Trash",
"errorMessage": "Unable to delete items. Source Item 'ATTRestCollection' is already in destination 'Trash'. Please specify different destination.",
"errorType": "collection",
"idList": "F8BDBD5812C1C10E3E5C1A1C45B3E9DD649028853801",
"title": "Unable to delete items. Source Item 'ATTRestCollection' is already in destination 'Trash'. Please specify different destination.",
"type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Example 3
The following example doesn’t delete a collection because the collection specified doesn't exist.
DELETE ...collections/F9BDBD5812C1C10E3E5C1A1C45B3E9DD649028853801
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 404
JSON Response
{
"errorCode": "-16",
"errorKey": "!csFldUnableToDeleteItems!csSecurityValidationFailed!csFldDoesNotExist,F9BDBD5812C1C10E3E5C1A1C45B3E9DD649028853801!csUnprivilegedSystemError",
"errorMessage": "Unable to delete items. Security validation failed. 'F9BDBD5812C1C10E3E5C1A1C45B3E9DD649028853801' does not exist. The error was caused by an internally generated issue. The error has been logged.",
"errorType": "collection",
"idList": "F9BDBD5812C1C10E3E5C1A1C45B3E9DD649028853801",
"title": "Unable to delete items. Security validation failed. 'F9BDBD5812C1C10E3E5C1A1C45B3E9DD649028853801' does not exist. The error was caused by an internally generated issue. The error has been logged.",
"type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Example 4
The following example doesn’t delete a collection because the collection is not owned by or shared with the user.
DELETE ...collections/F1FB95D79D849A0439DAA43045B3E9DD649028853801
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 403
JSON Response
{
"errorCode": "-20",
"errorKey": "!csFldUnableToDeleteItems!csCloudItemInsufficientPrivileges,UserAA,fFolderGUID:F1FB95D79D849A0439DAA43045B3E9DD649028853801,FLD_MOVE_TO_TRASH",
"errorMessage": "Unable to delete items. User 'UserAA' has insufficient privilege to access fFolderGUID:F1FB95D79D849A0439DAA43045B3E9DD649028853801 with service FLD_MOVE_TO_TRASH.",
"errorType": "collection",
"idList": "F1FB95D79D849A0439DAA43045B3E9DD649028853801",
"title": "Unable to delete items. User 'UserAA' has insufficient privilege to access fFolderGUID:F1FB95D79D849A0439DAA43045B3E9DD649028853801 with service FLD_MOVE_TO_TRASH.",
"type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}