Search Document or Folder Properties

POST /ws/rest/service/v1/dm/search

Purpose

Searches a document/folder properties.

Prerequisites

Ensure the following:

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

Request Format

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

To get the name field values:

  1. Go to the Company Workspace tab, and switch to Admin mode.
  2. In the left Navigator, select uDesigner, and then select Document Manager.
  3. Select the Folder and Document Attributes.
  4. From the toolbar, select Status, and select Draft.
  5. Open the applicable Folder or Document Properties form.
  6. From the toolbar, select Custom, and search for the field name using the given label.
Name Label
uuu_dm_node_name Name
uuu_dm_create_by Owner
uuu_file_title Title

Request Parameters

The following parameters can be included in the request:

Request Parameter Required? Data Type Description
projectnumber Yes String The project number/shell associated with the document/folder. If the project number is not specified, the document is created in the Company Workspace.
parentpath Yes String The path to locate the document/folder in the Document Manager.
match No String Specify this field when you want to search for multiple search query terms. Valid values include "AND" (default), "OR".
nodetype No String Indicate if you want to search for documents or folders. Valid values include "document", and "folder".

Request Parameters in Query JSON Object

For multiple search terms, each search term is joined with an AND condition. The following parameters can be included for multiple search terms in the request:

Field Name Required? Data Type Description
name Yes String

Specify the uDesigner field for filtering the search for the specified folder/document.

value Yes String The values specified for the search.
label No String

The label specified in uDesigner for a specific field.

value2 No String This is mostly used for range comparators to search for documents/folders created/issued in between the value and value2 fields.
Comparator No String

The type of search operation to perform. Valid values include:

"like" (default): For string data types, searches for a like query, %value%.

"eq": For string and numeric data types, searches for an exact match.

"lt": For numeric and date values, searches for less than the specified value.

"gt": For numeric and date values, searches for greater than the specified value.

"le": For numeric and date values, searches for less than or equal to the specified value.

"ge: For numeric and date values, searches for greater than or equal to the specified value.

"ne": For numeric and date values, searches for not equal to the specified value.

"range": For numeric and date values, searches for a range of values between "value" and "value2".

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.

The "data" is an array of document or folder properties matching the search terms specified in the request.

Sample Query Request

To search for documents with title like "first document title" and issue date between 2017-12-07T07:54 and 2017-20-07T07:54:

"query":[{ "name":"uuu_file_title", "label":"Title","value":"first document title", "comparator":"like" }, { "name":"uuu_file_issue_date", "label":"Issue Date", "value":"2017-12-07T07:54", "value2":"2017-20-07T07:54", "comparator":"range" } ]

Sample Request

For projectnumber:AP and parentpath: /trial1, send a query request in the following format:

query:[{ "name":"uuu_dm_node_name", "label":"Name","value":"Bug_Status.txt", "comparator":"like" }]

Sample Success Response

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

{

"data":

[

{

"uuu_lock_iserid":0,

"Revision No.":"",

"Owner":"Company Administrator",

"projectnumber":"AP",

"node_path":"/trial1/Bug_Status.txt",

"Description":"",

"Pub No.":"1",

"Size":"3529",

"Title":"trial text",

"type":"Document",

"Name":"Bug_Status.txt",

"parent_node_id":779,

"Creation Date":"2023/12/08 07:16",

"project_id":1008,

"uuu_content_status":0,

"file_longitude":null,

"file_id":526,

"file_latitude":null,

"Issue Date":"2023/05/12 12:30",

"Upload By":"Company Administrator",

"uuu_lock_owner":null,

"% Complete":"0",

"Location":"/trial1",

"node_id":806

}

],

"message": [ ],

"status":200

}

Sample Failed Request

The following request is sent with an invalid node_id, uuu_dm_node_name:

projectnumber:AP

parentpath:/trial156

query:[{ "name":"uuu_dm_node_name", "label":"Name","value":"Bug_Status.txt", "comparator":"like" }]

Sample Failed Response

A failed response to the above request is returned with a status code 1039 in the following format:

{

"data": [{

"comparator": "like",

"name": "uuu_dm_node_name",

"label": "Name",

"value": "Bug_Status.txt"

}],

"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
projectnumber Project number is invalid. 602 Project/Shell Number is not correct.
parentpath Path is invalid 1039 Parent path or node id is invalid or does not exist.
nodetype nodetype value is not valid. 1049 Invalid 'nodetype', please provide either 'document' or 'folder'.