Get Documents by Parent Folder ID

GET /ws/rest/service/v1/dm/document/<parent_node_id>

Purpose

Retrieves all the documents (files) and metadata under a folder using the parent folder node id.

Prerequisites

Ensure the following:

  • Configure the Document Manager in the shell where the document is to be retrieved.
  • You must have Get permissions to use this REST service of Document Manager.

Request Format

Send a request in the following format:

http://<host>:<port>/ws/rest/service/v1/dm/document/<parent_node_id>

Path Parameters

Specify the following path parameters:

Path Parameter Required? Data Type Description
parent_node_id Yes Integer The properties of the documents listed under this parent_node_id.
iszip No Boolean Generates a single zip for the document files if provided. Otherwise retrieves individual files. Valid values include: "yes", and "no".
blockScanPendingFiles No Boolean
Blocks or allows the download of files or attachments that have not been scanned for viruses. Valid values include false and true. False (the default) allows the download of unscanned files or attachments while true prevents it.

Note:

By default, attachments are downloaded through REST, whether or not they have been scanned for viruses. To download only those attachments that have been scanned and identified as clean, you must use the blockScanPendingFiles parameter.

Response Format

A JSON object is returned in the following format.

{

"data": [],

"message": [],

"status": <REST status code value>

}

A successful response displays a status code 200.

A failed response displays a message with a status code.

Sample Request

http://localhost:7003/ws/rest/service/v1/dm/document/885

Note:

parent_node_id is given as path parameter in the above request.

Sample Success Response

A successful response is returned with status 200 in the following format:

*Binary Data*

{

"data": [ ],

"message": [ ],

"status":200

}

Sample Failed Response

http://<host>:<port>/ws/rest/service/v1/dm/document/123456

Note:

parent_node_id is given as path parameter in the above request.

Sample Failed Response

A failed response for the above invalid parent_node_id displays in the following format:

{

"data": [ ],

"message":[

{"message":"Parent path or node id is invalid or does not exists."}

],

"status":1039

}

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.

Field Name Use-case Scenario Status Code Error Message
parent_node_id parent_node_id is invalid. 1039 Project/Shell Number is not correct.
parent_node_id parent_node_id is blank. 1039 Parent path or node id is invalid or does not exists.
iszip Random value is provided. 200

Success.

It assumes the default value as "yes" and generates a zip file.

blockScanPendingFiles Random string is provided. 11008 blockscanpendingfiles should be one of [true, false].