POST /ws/rest/service/v1/admin/project
Purpose:
To create project
Input:
Both input & output in JSON format in the body. This works only at company level.
Following are the fields that are supported under 'options' object
Element Name | Required | Description |
---|---|---|
copy_from_project_template | Yes | Specify project number or project template number |
copyModules | No | Option to either copy modules or not. This key can only go as a child element under options object. This key will be used to identify whether to create a new project by copying all modules including user / group or just creates a new project by copying user / group from another project or template. Only valid values are Yes / No. Yes means copy all modules including user / groups. No means copy only user / groups. If this key is not provided or value is empty then default behavior will be to create project by copying user / groups. |
Following are the fields that are supported under 'data' list object
Element Name | Required | Description |
---|---|---|
projectnumber | Yes | Project number of the new project that is getting created. Multiple projects with same project number can exist. User defined number. |
projectname | Yes | Project name of the new project that is getting created. If this project name already exists you will get an error. User defined name. |
projectCurrency | No | Option to specify the project currency. Valid values for this field are the code for the currency rather than the names. For example, USD is valid, United States Dollars is not. If the code is not a valid code then the web service will fail. If this key is not provided or value is empty then projectCurrency value of the template will be taken. |
constructiontype | No | Type of construction (New Construction or Retrofit/Remodel). |
status | No | Status of the Project (Active, Inactive, On-Hold) |
typeofproject | No | Type of Project. Values are based on the user dataset for "Project Type" data definition |
projectsite | No | Project site. Values are based on the user dataset for "Project Site" data definition |
startdate | No | Start Date of the project. |
plannedcompletion | No | Planned Completion date |
revisedcompletion | No | Revised Completion date |
designcomplete | No | Design % complete |
constrcomplete | No | Construction % complete |
notes | No | Notes |
schedulestatus | No | Schedule status of the project |
projectphase | No | Project phase information.Values are based on the user dataset for "Project Phase" data definition |
description | No | Description of the project |
Following are the fields that are supported under 'location' object
Element Name | Required | Description |
---|---|---|
location | No | Base object for project location/address information. If this location key is not provided then Primavera Unifier will create Project by copying "Project Address" information from template. |
address | No | Base object for address information. This object can be repeated to provide multiple address types |
address1 | Yes | Address 1 field of the project. This field is child element of 'address' object. This element is required if address object is provided |
address2 | No | Address 2 field of the project. This field is child element of 'address' object |
city | Yes | City field of the project and it is child element of 'address' object. This element is required if address object is provided |
state | Yes | State field of the project and it is child element of 'address' object. This element is required if address object is provided |
country | Yes | Country field of the project and it is child element of 'address' object. This element is required if address object is provided |
phone | No | Phone field of the project and it is child element of 'address' object. |
fax | No | Fax filed of the project and it is child element of 'address' object. |
addresstype | Yes | Type of address and it is child element of 'address' object. Following are the valid values for this field
|
Notes:
- Integration users should have 'create' permission of 'Company Administration' permission set to create project through REST services.
- If any non required values are not provided in the input JSON then the respective values from the template will be taken.
Create Project input JSON
{
"options":
{
"copy_from_project_template":"ProjectTemplate1",
"project_currency": "AFN",
},
"data": [
{
"projectnumber":"Project1",
"projectname":"Rest Project 1",
"constructiontype:"New Construction",
"status":"Active",
"location":{
"address":[
{
"address1": "Address1",
"address2": "Address2",
"addresstype": "Project Address",
"city": "Hyderabad",
"state": "Telangana",
"country": "India",
"phone": 9999988889,
"zip": "506454"
},
{
"address1": "Xyz",
"address2": "Pqr",
"addresstype": "Billing",
"city": "Hyderabad",
"state": "Telangana",
"country": "India",
"phone": 9999999999,
"zip": "516454"
}
]
}
},
{
"projectnumber":"Project2",
"projectname":"Rest Project 2"
}
]
}
Output:
JSON object containing 'status', 'data', 'message'
Create Project output JSON
{
"data":
[
],
"message":
[
{
"projectnumber":"Project 1",
"projectname":"Rest Project 1",
"message":"Project Template/Project name already exists. ",
"status":612
},
{
"projectnumber":"Project 2",
"projectname":"Rest Project 2",
"message":"success",
"status":200
}
],
"status":3000
}
Status codes are:
1> 200 , for success
2> 3000, for partial success