How can we help?
{{docApp.searchError}}
{{product.name}}
Searching in {{docApp.searchFilterBySpecificBookTitle}}
{{docApp.searchResultFilteredItems.length}} results for: {{docApp.currentResultsSearchText}}
in {{docApp.searchFilterBySpecificBookTitle}}
Search results have been limited. There are a total of {{docApp.searchResponse.totalResultsAvailable}} matches.
You have an odd number of " characters in your search terms - each one needs closing with a matching " character!
-
{{resultItem.title}}
{{resultItem.url}}
{{docApp.libraryHomeViewProduct.title || docApp.libraryHomeViewProduct.id}}
{{docApp.libraryHomeViewProduct.description}}
{{group.title || group.id}}
{{group.description}}
Operation Information
- Application Reference:
com.hornbill.projectmanager
- Scope:
Entity - Projects
- Class:
Entity
- Required Privilege Level:
user
- Required Rights: Group E - canCreateProjects
Description
This flowcode operation creates a new project.
Request Parameters
The addProject API takes the following input parameters. It is important to note that the parameters must satisfy the requirement of the input validation checks.
Name | Type | Required | Description |
---|---|---|---|
name |
xs:string |
No | The name of the project. |
description |
xs:string |
No | A description of the project. |
projectScope |
xs:string |
No | The scope of the project. |
projectTypeId |
xs:integer |
No | The primary key of the project type. |
qualityStatement |
xs:string |
No | The project's quality statement. |
scheduledStartDate |
xs:dateTime |
No | The project's scheduled start date. |
scheduledEndDate |
xs:dateTime |
No | The project's scheduled end date. |
startDate |
xs:dateTime |
No | The project's actual start date. |
endDate |
xs:dateTime |
No | The project's actual end date. |
status |
xs:string |
Yes | The status of the project. Accepted values are (status.draft, status.active). |
subStatus |
xs:string |
No | The Project Sub Status value taken from the simple list. e.g. 'subStatus.pipeline' |
businessProcess |
xs:string |
No | The id of the business process that will run against the project. |
budgetCurrency |
xs:string |
No | The currency of the project's budget. |
budget |
xs:decimal |
No | The project's budget. |
projectTemplateId |
xs:integer |
No | The primary key of the project template. |
projectManagerId |
xs:string |
No | The user id of the project manager of the new project. Specifying a project manager will override the application setting of making the project creator the project manager. |
businessBenefits |
xs:string |
No | Business benefits of the project. |
lessonsLearnt |
xs:string |
No | Lessons learnt during the project. |
reasons |
xs:string |
No | Reasons for doing the project. |
customA1 |
xs:string |
No | Custom Field A1 (varchar). |
customA2 |
xs:string |
No | Custom Field A2 (varchar). |
customA3 |
xs:string |
No | Custom Field A3 (varchar). |
customA4 |
xs:string |
No | Custom Field A4 (varchar). |
customA5 |
xs:string |
No | Custom Field A5 (varchar). |
customB1 |
xs:string |
No | Custom Field B1 (text). |
customB2 |
xs:string |
No | Custom Field B2 (text). |
customB3 |
xs:string |
No | Custom Field B3 (text). |
customB4 |
xs:string |
No | Custom Field B4 (text). |
customB5 |
xs:string |
No | Custom Field B5 (text). |
customC1 |
xs:dateTime |
No | Custom Field C1 (datetime). |
customC2 |
xs:dateTime |
No | Custom Field C2 (datetime). |
customC3 |
xs:dateTime |
No | Custom Field C3 (datetime). |
customC4 |
xs:dateTime |
No | Custom Field C4 (datetime). |
customC5 |
xs:dateTime |
No | Custom Field C5 (datetime). |
customD1 |
xs:integer |
No | Custom Field D1 (integer). |
customD2 |
xs:integer |
No | Custom Field D2 (integer). |
customD3 |
xs:integer |
No | Custom Field D3 (integer). |
customD4 |
xs:integer |
No | Custom Field D4 (integer). |
customD5 |
xs:integer |
No | Custom Field D5 (integer). |
relatedRequestId |
xs:string |
No | The id of a Service Manager request to link to the project. |
relatedRequestType |
xs:string |
No | The type of relationship to the related request. E.g. projectRelationship.connectedTo |
Response Parameters
Name | Type | Description |
---|---|---|
outcome |
xs:string |
The outcome of the flowcode operation. |
projectId |
xs:integer |
The id of the new project. |
projectName |
xs:string |
The name of the new project. |
warnings |
xs:string |
Any errors encountered when spawning a business process against the new project. |
Code Examples
curl -X POST 'https://api.hornbill.com/yourinstanceid/xmlmc/apps/com.hornbill.projectmanager/Projects' \
-H 'Authorization: ESP-APIKEY yourHornbillAPIKey' \
-H 'Content-Type: application/json' \
-d '{"@service":"apps/com.hornbill.projectmanager/Projects","@method":"addProject","params":{"name":"xs:string","description":"xs:string","projectScope":"xs:string","projectTypeId":1,"qualityStatement":"xs:string","scheduledStartDate":"xs:dateTime","scheduledEndDate":"xs:dateTime","startDate":"xs:dateTime","endDate":"xs:dateTime","status":"xs:string","subStatus":"xs:string","businessProcess":"xs:string","budgetCurrency":"xs:string","budget":1.23,"projectTemplateId":1,"projectManagerId":"xs:string","businessBenefits":"xs:string","lessonsLearnt":"xs:string","reasons":"xs:string","customA1":"xs:string","customA2":"xs:string","customA3":"xs:string","customA4":"xs:string","customA5":"xs:string","customB1":"xs:string","customB2":"xs:string","customB3":"xs:string","customB4":"xs:string","customB5":"xs:string","customC1":"xs:dateTime","customC2":"xs:dateTime","customC3":"xs:dateTime","customC4":"xs:dateTime","customC5":"xs:dateTime","customD1":1,"customD2":1,"customD3":1,"customD4":1,"customD5":1,"relatedRequestId":"xs:string","relatedRequestType":"xs:string"}}'
package main
import (
"fmt"
apiLib "github.com/hornbill/goApiLib"
)
func main() {
hornbillAPI := apiLib.NewXmlmcInstance("yourinstanceid")
hornbillAPI.SetAPIKey("yourHornbillAPIKey")
hornbillAPI.SetJSONResponse(true)
hornbillAPI.SetParam("name", "xs:string")
hornbillAPI.SetParam("description", "xs:string")
hornbillAPI.SetParam("projectScope", "xs:string")
hornbillAPI.SetParam("projectTypeId", "xs:integer")
hornbillAPI.SetParam("qualityStatement", "xs:string")
hornbillAPI.SetParam("scheduledStartDate", "xs:dateTime")
hornbillAPI.SetParam("scheduledEndDate", "xs:dateTime")
hornbillAPI.SetParam("startDate", "xs:dateTime")
hornbillAPI.SetParam("endDate", "xs:dateTime")
hornbillAPI.SetParam("status", "xs:string")
hornbillAPI.SetParam("subStatus", "xs:string")
hornbillAPI.SetParam("businessProcess", "xs:string")
hornbillAPI.SetParam("budgetCurrency", "xs:string")
hornbillAPI.SetParam("budget", "xs:decimal")
hornbillAPI.SetParam("projectTemplateId", "xs:integer")
hornbillAPI.SetParam("projectManagerId", "xs:string")
hornbillAPI.SetParam("businessBenefits", "xs:string")
hornbillAPI.SetParam("lessonsLearnt", "xs:string")
hornbillAPI.SetParam("reasons", "xs:string")
hornbillAPI.SetParam("customA1", "xs:string")
hornbillAPI.SetParam("customA2", "xs:string")
hornbillAPI.SetParam("customA3", "xs:string")
hornbillAPI.SetParam("customA4", "xs:string")
hornbillAPI.SetParam("customA5", "xs:string")
hornbillAPI.SetParam("customB1", "xs:string")
hornbillAPI.SetParam("customB2", "xs:string")
hornbillAPI.SetParam("customB3", "xs:string")
hornbillAPI.SetParam("customB4", "xs:string")
hornbillAPI.SetParam("customB5", "xs:string")
hornbillAPI.SetParam("customC1", "xs:dateTime")
hornbillAPI.SetParam("customC2", "xs:dateTime")
hornbillAPI.SetParam("customC3", "xs:dateTime")
hornbillAPI.SetParam("customC4", "xs:dateTime")
hornbillAPI.SetParam("customC5", "xs:dateTime")
hornbillAPI.SetParam("customD1", "xs:integer")
hornbillAPI.SetParam("customD2", "xs:integer")
hornbillAPI.SetParam("customD3", "xs:integer")
hornbillAPI.SetParam("customD4", "xs:integer")
hornbillAPI.SetParam("customD5", "xs:integer")
hornbillAPI.SetParam("relatedRequestId", "xs:string")
hornbillAPI.SetParam("relatedRequestType", "xs:string")
responseBody, apiError := hornbillAPI.Invoke("apps/com.hornbill.projectmanager/Projects", "addProject")
if apiError != nil {
fmt.Println(apiError)
return
}
fmt.Println(responseBody)
}
const endpoint = "https://api.hornbill.com/yourinstanceid/xmlmc/apps/com.hornbill.projectmanager/Projects";
const payload = {
"@service": "apps/com.hornbill.projectmanager/Projects",
"@method": "addProject",
"params": {
"name": "xs:string",
"description": "xs:string",
"projectScope": "xs:string",
"projectTypeId": 1,
"qualityStatement": "xs:string",
"scheduledStartDate": "xs:dateTime",
"scheduledEndDate": "xs:dateTime",
"startDate": "xs:dateTime",
"endDate": "xs:dateTime",
"status": "xs:string",
"subStatus": "xs:string",
"businessProcess": "xs:string",
"budgetCurrency": "xs:string",
"budget": 1.23,
"projectTemplateId": 1,
"projectManagerId": "xs:string",
"businessBenefits": "xs:string",
"lessonsLearnt": "xs:string",
"reasons": "xs:string",
"customA1": "xs:string",
"customA2": "xs:string",
"customA3": "xs:string",
"customA4": "xs:string",
"customA5": "xs:string",
"customB1": "xs:string",
"customB2": "xs:string",
"customB3": "xs:string",
"customB4": "xs:string",
"customB5": "xs:string",
"customC1": "xs:dateTime",
"customC2": "xs:dateTime",
"customC3": "xs:dateTime",
"customC4": "xs:dateTime",
"customC5": "xs:dateTime",
"customD1": 1,
"customD2": 1,
"customD3": 1,
"customD4": 1,
"customD5": 1,
"relatedRequestId": "xs:string",
"relatedRequestType": "xs:string"
}
};
fetch(endpoint, {
method: 'POST',
headers: {
"Authorization": "ESP-APIKEY yourHornbillAPIKey"
},
body: JSON.stringify(payload)
}).then(res => res.json())
.then(res => console.log(res));
const axios = require('axios');
const endpoint = "https://api.hornbill.com/yourinstanceid/xmlmc/apps/com.hornbill.projectmanager/Projects";
const payload = {
"@service": "apps/com.hornbill.projectmanager/Projects",
"@method": "addProject",
"params": {
"name": "xs:string",
"description": "xs:string",
"projectScope": "xs:string",
"projectTypeId": 1,
"qualityStatement": "xs:string",
"scheduledStartDate": "xs:dateTime",
"scheduledEndDate": "xs:dateTime",
"startDate": "xs:dateTime",
"endDate": "xs:dateTime",
"status": "xs:string",
"subStatus": "xs:string",
"businessProcess": "xs:string",
"budgetCurrency": "xs:string",
"budget": 1.23,
"projectTemplateId": 1,
"projectManagerId": "xs:string",
"businessBenefits": "xs:string",
"lessonsLearnt": "xs:string",
"reasons": "xs:string",
"customA1": "xs:string",
"customA2": "xs:string",
"customA3": "xs:string",
"customA4": "xs:string",
"customA5": "xs:string",
"customB1": "xs:string",
"customB2": "xs:string",
"customB3": "xs:string",
"customB4": "xs:string",
"customB5": "xs:string",
"customC1": "xs:dateTime",
"customC2": "xs:dateTime",
"customC3": "xs:dateTime",
"customC4": "xs:dateTime",
"customC5": "xs:dateTime",
"customD1": 1,
"customD2": 1,
"customD3": 1,
"customD4": 1,
"customD5": 1,
"relatedRequestId": "xs:string",
"relatedRequestType": "xs:string"
}
};
const axiosConfig = {
headers: {
"Authorization": "ESP-APIKEY yourHornbillAPIKey"
}
};
axios.post(endpoint, payload, axiosConfig)
.then((res) => {
console.log("RESPONSE RECEIVED: ", res);
})
.catch((err) => {
console.log("AXIOS ERROR: ", err);
})
$endpoint = "https://api.hornbill.com/yourinstanceid/xmlmc/apps/com.hornbill.projectmanager/Projects";
$payload = (object) [
'@service' => 'apps/com.hornbill.projectmanager/Projects',
'@method' => 'addProject',
'params' => (object) [
'name' => 'xs:string',
'description' => 'xs:string',
'projectScope' => 'xs:string',
'projectTypeId' => 'xs:integer',
'qualityStatement' => 'xs:string',
'scheduledStartDate' => 'xs:dateTime',
'scheduledEndDate' => 'xs:dateTime',
'startDate' => 'xs:dateTime',
'endDate' => 'xs:dateTime',
'status' => 'xs:string',
'subStatus' => 'xs:string',
'businessProcess' => 'xs:string',
'budgetCurrency' => 'xs:string',
'budget' => 'xs:decimal',
'projectTemplateId' => 'xs:integer',
'projectManagerId' => 'xs:string',
'businessBenefits' => 'xs:string',
'lessonsLearnt' => 'xs:string',
'reasons' => 'xs:string',
'customA1' => 'xs:string',
'customA2' => 'xs:string',
'customA3' => 'xs:string',
'customA4' => 'xs:string',
'customA5' => 'xs:string',
'customB1' => 'xs:string',
'customB2' => 'xs:string',
'customB3' => 'xs:string',
'customB4' => 'xs:string',
'customB5' => 'xs:string',
'customC1' => 'xs:dateTime',
'customC2' => 'xs:dateTime',
'customC3' => 'xs:dateTime',
'customC4' => 'xs:dateTime',
'customC5' => 'xs:dateTime',
'customD1' => 'xs:integer',
'customD2' => 'xs:integer',
'customD3' => 'xs:integer',
'customD4' => 'xs:integer',
'customD5' => 'xs:integer',
'relatedRequestId' => 'xs:string',
'relatedRequestType' => 'xs:string',
]
];
$headers = [
'Authorization: ESP-APIKEY yourHornbillAPIKey',
'Content-Type: application/json'
];
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $endpoint);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$resp = curl_exec($curl);
curl_close($curl);
echo $resp;
$Endpoint = "https://api.hornbill.com/yourinstanceid/xmlmc/apps/com.hornbill.projectmanager/Projects"
$Body = @{
"@service" = "apps/com.hornbill.projectmanager/Projects"
"@method" = "addProject"
params = @{
name = "xs:string"
description = "xs:string"
projectScope = "xs:string"
projectTypeId = "xs:integer"
qualityStatement = "xs:string"
scheduledStartDate = "xs:dateTime"
scheduledEndDate = "xs:dateTime"
startDate = "xs:dateTime"
endDate = "xs:dateTime"
status = "xs:string"
subStatus = "xs:string"
businessProcess = "xs:string"
budgetCurrency = "xs:string"
budget = "xs:decimal"
projectTemplateId = "xs:integer"
projectManagerId = "xs:string"
businessBenefits = "xs:string"
lessonsLearnt = "xs:string"
reasons = "xs:string"
customA1 = "xs:string"
customA2 = "xs:string"
customA3 = "xs:string"
customA4 = "xs:string"
customA5 = "xs:string"
customB1 = "xs:string"
customB2 = "xs:string"
customB3 = "xs:string"
customB4 = "xs:string"
customB5 = "xs:string"
customC1 = "xs:dateTime"
customC2 = "xs:dateTime"
customC3 = "xs:dateTime"
customC4 = "xs:dateTime"
customC5 = "xs:dateTime"
customD1 = "xs:integer"
customD2 = "xs:integer"
customD3 = "xs:integer"
customD4 = "xs:integer"
customD5 = "xs:integer"
relatedRequestId = "xs:string"
relatedRequestType = "xs:string"
}
}
$Header = @{
"Authorization" = "ESP-APIKEY yourHornbillAPIKey"
}
$Parameters = @{
Method = "POST"
Uri = $Endpoint
Headers = $Header
Body = ($Body | ConvertTo-Json)
ContentType = "application/json"
}
Invoke-RestMethod @Parameters
import requests
import json
endpoint = "https://api.hornbill.com/yourinstanceid/xmlmc/apps/com.hornbill.projectmanager/Projects"
headers = {
"Authorization": "ESP-APIKEY yourHornbillAPIKey"
}
payload={
"@service":"apps/com.hornbill.projectmanager/Projects",
"@method":"addProject",
"params":{
"name":"xs:string",
"description":"xs:string",
"projectScope":"xs:string",
"projectTypeId":"xs:integer",
"qualityStatement":"xs:string",
"scheduledStartDate":"xs:dateTime",
"scheduledEndDate":"xs:dateTime",
"startDate":"xs:dateTime",
"endDate":"xs:dateTime",
"status":"xs:string",
"subStatus":"xs:string",
"businessProcess":"xs:string",
"budgetCurrency":"xs:string",
"budget":"xs:decimal",
"projectTemplateId":"xs:integer",
"projectManagerId":"xs:string",
"businessBenefits":"xs:string",
"lessonsLearnt":"xs:string",
"reasons":"xs:string",
"customA1":"xs:string",
"customA2":"xs:string",
"customA3":"xs:string",
"customA4":"xs:string",
"customA5":"xs:string",
"customB1":"xs:string",
"customB2":"xs:string",
"customB3":"xs:string",
"customB4":"xs:string",
"customB5":"xs:string",
"customC1":"xs:dateTime",
"customC2":"xs:dateTime",
"customC3":"xs:dateTime",
"customC4":"xs:dateTime",
"customC5":"xs:dateTime",
"customD1":"xs:integer",
"customD2":"xs:integer",
"customD3":"xs:integer",
"customD4":"xs:integer",
"customD5":"xs:integer",
"relatedRequestId":"xs:string",
"relatedRequestType":"xs:string",
},
}
response = requests.request("POST", endpoint, json=payload, headers=headers)
print(response.text)
- Version {{docApp.book.version}}
- Node {{docApp.node}} / {{docApp.build}}
In This Document