跳到主要内容

deleteFolder

FileOperationArrayWrapper deleteFolder(folderId, DeleteFolderRequest)

DELETE /api/2.0/files/folder/{folderId}

Delete a folder

Queues the deletion of one folder together with everything inside it, and answers with the file operations of the caller, the one just created among them. The folder is not gone when the response arrives: poll GET api/2.0/files/fileops until the operation reports finished, and read its error to learn whether the deletion succeeded. By default the folder is moved to the Trash section, from where it can be restored; immediately=true discards it for good instead, and inside a room, where there is no Trash, deletion is always final. deleteAfter=true postpones the deletion until the editing sessions on the contents have ended, so files somebody is working on are not pulled away. The caller needs the right to delete the folder, which the room manager, a portal administrator acting as room manager and a content creator acting on a folder of their own have; editing access alone, read access and a guest are refused. The call is destructive. To delete several items at once use PUT api/2.0/files/fileops/delete.

Parameters​

NameInTypeDescriptionNotes
folderIdpathInteger (int32)The folder to delete, together with everything it holds.[required] [example: 10]
DeleteFolderRequestbodyDeleteFolderRequestHow the deletion is to be carried out.[required]

Responses​

Status codeDescriptionTypeResponse headers
200The file operations of the caller, including the deletion just queuedFileOperationArrayWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
403The caller may not delete the folder, or the folder is a room and immediately is not set--
404The folder does not exist--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
400Bad Request.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

FileOperationArrayWrapper

Third-party storage​

For a file or folder in a connected third-party storage the identifier is a string such as sbox-42, and the call differs in these parts only:

NameInTypeDescriptionNotes
folderIdpathStringThe folder to delete, together with everything it holds.[required] [example: sbox-42]

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json