Update Folder Metadata by Folder ID
POST /ws/rest/service/v1/dm/folder/update/<node_id>
Purpose
This service allows user to update a specific folder meta data using the folder node id.
Prerequisites
To use this REST service:
- Configure the Document Manager (DM) in the shell where folder is to be created.
- To include categories and phases in the request, ensure the categories are configured in the Project Phase.
- Go to the Company Workspace tab, and switch to Admin mode.
- In the left Navigator, select Data Structure Setup, select Data Definitions, and then select Basic.
- Open Project Phase.
Multiple categories and phases can be included in the request.
- As an integration user, you must also have update access on DM functionality.
Request Format
Send a request in the following format.
(Form Data (content type : application/x-www-form-urlencoded))
http://<host>:<port>/ws/rest/service/v1/document/update/<node_id>
Note:
Use the Get Folders or Documents Meta Data by Path REST service to get the node_id value for the folder.Supported Request Parameters
The following parameters can be included in the request:
| Request Parameter | Required? | Data Type | Description |
|---|---|---|---|
| node_id | Yes | String | The node_id whose meta data is to be updated. |
| Data JSON Map: The following parameter can be included. | |||
| Name | No | String |
The name of the folder whose meta data is being updated. A maximum length of 250 characters is supported. Names that will not be supported are those that contain non-printable ascii, names with trailing spaces, and the special names "." and "..". |
Sample Request
To update the folder, "trial2" under "/abcd10/f2" specified in the path parameter with node_id 754
(Form Data (content type : application/x-www-form-urlencoded))
http://localhost:7003/ws/rest/service/v1/dm/folder/update/754
data:[ {"Name":"trial2" } ]
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 input values.Sample Success Response
This is an example of a successful response to the above sample request.
{
"data": [
{
"Path": "/abcd10/f2",
"Name": "trial2"
}
],
"message": [
{
"message": "OK"
}
],
"status": 200
}
Note:
Use the GET call to get the structure of the JSON data.Sample Failed Response
This is an example of a failed response to a request when an invalid node_id is specified in the request.
{
"data":[
{
"Creation Date":"01/01/2016",
"Comments":"Fold 2 update dmpick",
"% Complete":"100",
"Name":"DmPicker"
}
],
"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 |
|---|---|---|---|
| node_id | The node_id is invalid. | 1039 | Parent path or node id is invalid or does not exist. |
| node_id | The project number is blank. | 500 | Server Error, Contact System Administrator. |
| Name | The Name is blank. | 505 | Input Required: Name |
| Name | Renamed a folder in a blank shell. | 505 | Invalid folder name. |
| Name | Renamed a root folder. | 505 | Root folder cannot be renamed. |
| Name | An existing folder is duplicated (case-insensitive) | 505 | Folder with given name already exists |