Delete Folders by Node ID

POST /ws/rest/service/v1/dm/folder/delete/<node_id>

Purpose

Delete folders using the node_id.

Prerequisites

Ensure you have:

  • Configured the Document Manager in the shell where folder is to be deleted.
  • The required Delete permission for Folder Services in the Document Manager.

Request Format

Form Data (content type : application/x-www-form-urlencoded)

Path Parameter

The following parameter must be specified in the request:

Path Parameter Required? Data Type Description
node_id Yes Integer The node ID of the folder to be deleted.

Response Format

A JSON object is returned in the following format:

{

"data": [],

"message": [<list of messages>],

"status": <REST status code value>,

"rest_audit_id": <id from the audit table>

}

A successful response displays a status code 200.

A failed response displays a message with a status code.

Sample Success Request

Send a request to delete a folder with node_id 555 in the following format:

http://localhost:7003/ws/rest/service/v1/dm/folder/delete/555

Sample Success Response

A successful response returns a status code 200 in the following format:

{

"data": [],

"message": [{"message":"Folder/File successfully deleted. Please check in Recycle bin."}],

"status":200

}

Sample Failed Response

An incorrect node_id specified in the request returns a response with an error status code and message in the following format:

{

"data": [],

"message": [{"message":"Node path or node id is invalid or does not exists."}],

"status":12764

}

Supported Validation Messages and Status Codes

The following validation messages and status codes display in the response when incorrect values are provided in the request:

Use-case Scenario Status Code Error Message
Files in the folder are linked to BP records. 12762 Files in the folder or sub-folders is linked to BP Records/Reports and cannot be deleted.
Files in the folder include checked-out or locked documents. 12763 Files in the folder or sub-folders include checked out or locked documents and cannot be deleted.
File or folder successfully deleted. 200 Folder/File successfully deleted.
Node ID or path is invalid or incorrect. 12764 Node path or node id is invalid or does not exists.
Project/Shell number is incorrect. 602 Project/Shell Number is not correct. Check Recycle bin.
Project/Shell is inactive. 1245 Create/Update/Delete cannot be performed when project/shell status is Inactive or View-Only or On-Hold.
Delete "Project Documents" root folder from the Company Workspace. 12768 You cannot delete the 'Project Documents' folder.