Update Document's Metadata by Path

POST /ws/rest/service/v1/dm/document/update

Purpose

Modifies the metadata for a document in a folder using the folder path value.

Request Format

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

Request Parameters

The following parameters can be included in the request:

Request Parameter Required? Data Type Description
projectnumber No String

The project number for the project /shell level DM. Not required for company level.

If the project number is not specified, the document is created in the Company Workspace. If the parent folder Id is not in the Company Workspace, the document will not be visible even in Company Workspace.

Request Parameters in data JSON Object

The data JSON object contains a List of field and values for the Document Attribute Form. The following parameters can be included in this object:

Request Parameter Required? Data Type Description
Path Yes String The full path of the document to update. For example, Example "/Project Documents/Service docs/Folder1/pipeline estimate.doc"
Description No String A description about the document to be updated.
Name No String The name to be used for renaming the document.
Title No String The title of the document.
Revision No. No Integer The revision number of the file when it is duplicated with the same file name.
Issue Date No Date The date on which the document was originally issued.
% Complete No Integer The amount of work completed on that type of file/document.

Response Format

A JSON object is returned in the following format.

{

"data": [],

"message": [],

"status": <REST status code value>

}

Note:

The read-only fields will not be updated with values from input.

Sample Request

To update a document "response.tif" in the "/test" folder, specify the request as:

projectnumber: "AP"

and

data:[{"Path":"/test/response(2 ).tif",

"Title":"Tiff File ",

"Description":"Viewing file as tiff fo r an output",

"Revision No.":"1",

"% Co mplete":"100",

"Issue Date": "01/18/2024 11:44 AM"

}]

Use the Get Folders or Documents Metadata by Path or Get Folders or Documents Metadata by Parent Folder ID to get the structure of the JSON data.

Sample Success Response

The REST service returns a successful response with status code 200 for the above request:

{

"data":[{

"Path":"/test/response(2).tif",

"Revision No.":"1",

"Description":"Viewing file as tiff for an output",

"Title":"Tiff File",

"Issue Date":"01/18/2024 11:44 AM",

"% Complete":"100"

}],

"message":[{"message":"OK"}],

"status":200

}

Sample Error Request

The following request is sent specifying an invalid folder name, test.

projectnumber:AP

data:[{"Path":"/test/trialtes.doc",

"% Complete":"100"

}]

Sample Failed Response

A failed response displays in the following format with status code 505 when an invalid folder is specified:

{

"data":[{

"Path":"/test/trialtes.d oc",

"% Complete":"100"

}],

"message":[{"message":"Invalid folder name."}],

"status":505

}

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.
projectnumber project number is blank and path is invalid. 505 Invalid folder name.
Path Path is invalid. 1039 Parent path or node id is invalid or does not exists.
Path Path is blank. 500 Server Error, contact system administrator.
Description Description exceeds 4000 characters. 505  
Name File name is blank or just the file extension is specified. 505 New file name is not valid
Name Invalid Name is given(against the rules of naming). 200 (uploading even invalid)
Name Existing folder name is duplicated(upper or lower case). 200 (appends (1) to the name and updates.)
Name Name is a read-only field. 505 Cannot rename as the node_name field is readonly.
Name Document is locked. 505 Cannot rename locked node.
Name File extension is changed. 505 File extension cannot be changed.
Name Current name is specified as the new name. 505 New node name and old node name are same.
Title Title exceeds 250/2000 characters. 505  
Revision No. Revision No. exceeds 250/2000 characters. 505  
Issue Date Date is invalid.    
% Complete Characters are given 200 In UI, characters are not reflected instead "0" is kept.