Create Folders by Parent Folder ID
POST /ws/rest/service/v1/dm/folder/create/<parent_folder_id>
Purpose
This service allows you to create folders under a specific folder. The parent folder is specified as node id in the service call's path parameter.
Prerequisites
To use this REST service:
- Configure the Document Manager 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 create access on DM functionality.
Request Format
Send an API request in the following format.
(Form Data (content type : application/x-www-form-urlencoded))<parent_node_id value>
data:[
{
"Path": "<value>",
"Description": "<value>",
"Phases": "<value>",
"Categories": "<value>",
"Name": "<value>"
}
]
Note:
parent_node_id can be provided as a part of path parameter in request.Supported Request Parameters
The following parameters can be included in the request:
| Request Parameter | Required? | Data Type | Description |
|---|---|---|---|
| parent_node_id | Yes | Integer |
The node_id under which the folder is created. To get the node_id value for the parent folder, use the Get Folders or Documents Meta Data by Path REST service. |
|
Data JSON Map: The following parameters can be included. All other fields are required or optional based on the Attribute form design. |
|||
| Name | Yes | String |
Name of the folder to be created. 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 "..". |
| Description | No | String | A short description of the folder's purpose. |
| Categories | No | String | The folder category associated with the folder to be created. |
| Phases | No | String | The phase associated with the folder to be created. For example, Preplanning. |
Sample Request
To create a "2023" folder under "/Project Documents/Service docs" whose node id (2002896) is specified in path parameter, send the request as shown below:
URL:http://unifier-intg.oracle.com/ws/rest/dm/folder/create/2002896
data:[
{
"Name":"2023",
"Owner":"Company Administrator",
"Creation Date":"01/01/2016",
"% Complete":"100",
"Description":"Fold 1"
}
]
Response Format
A JSON object is returned in the following format:
Note:
The data will be same as input data with new folder id and parent folder ID.
{
"data": [],
"message": [],
"status": <REST status code value>,
"rest_audit_id": <value>
}
Sample Success Response
In addition to the data, a successful response displays:
- a response "status" code of 200
- a
_record_statuskey with a "SUCCESS" value or an error message
{
"data":
[
{
"Path":"/Service docs",
"Creation Date":"01/01/2016",
"Owner":"Company Administrator",
"Description":"Fold 1",
"% Complete":"100",
"Name":"REST Folder",
"node_id":"2003152"
}
],
"message":
[
{
"message":"OK"
}
],
"status":200
}
Sample Failed Response
The following is an example of a failed response.
{
"data":
[
{
"Path":"/Service docs",
"Creation Date":"01/01/2016",
"Owner":"Company Administrator",
"Description":"Fold 1",
"% Complete":"100",
"Name":"REST Folder"
}
],
"message":
[
{
"message":"Folder with given name already exists"
}
],
"status":1043
}
Supported Validation Messages and Status Codes
The following error 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 blank. | 500 | Server Error, Contact System Administrator. |
| parent_node_id | parent_node_id is invalid. | 1039 | Parent path or node id is invalid or does not exist. |
| Name | Name is blank. | 1043 | Input Name Required-Empty Name Given. |
| Name | Name is not specified in the data JSON object. | 1043 | Server Error, contact system administrator. |
| Name | An existing Name is specified (case-insensitive). | 1043 | Folder with given name already exists. |
| Description | The Description exceeds 2000 characters. | 1043 | Valid Input required for fields: 'Description'. |
| Categories | An invalid Category is specified | 1043 | Invalid Categories, Please provide correct Category values. |
| Phases | An invalid Phase is specified. | 1043 | Invalid Phases, Please provide correct Phase values. |