Delete Documents by Node ID

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

Purpose

Delete documents 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 Document 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 document 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/580

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
The file is linked to BP records/reports and cannot be deleted. 12766 The file is linked to BP records/reports and cannot be deleted.
Selected file is checked-out or locked. 12767 The file is checked out or locked documents and cannot be deleted.
Node ID or path is invalid or incorrect. 12764 Node path or node id is invalid or does not exist.
File or folder successfully deleted. 200 Folder/File successfully deleted. Check Recycle bin.
Project/Shell number is incorrect. 602 Project/Shell Number is not correct.
Project/Shell is inactive. 1245 Create/Update/Delete cannot be performed when project/shell status is Inactive or View-Only or On-Hold.