Create or Modify Project
Request : POST /papi/v1/project
Save a new project or edit an existing one. If the project Id = 0 or not defined then the project is saved as a new.
Parameter | Parameter Type | Mandatory | Description |
---|---|---|---|
Project Object | Body (JSON) | yes | Project object. Check the project data model definitions from the swagger documentation https://grano.emmi.fi/papi/v1/swagger/ui/index#!/Project/POST_project |
x-auth-token | Header | yes | The authentication token must be provided as an x-auth-token header for every API request. More information about authentication token. |
Response: Project Id (string).
cURL example creating a new project to a root hierarchy.
curl --location --request POST 'https://[EMMi instance]/papi/v1/project' \
--header 'Content-Type: application/json' \
--header 'x-auth-token: [Session token]' \
--data-raw '{
"Id": "0",
"ParentId": "0",
"Name": "My First EMMi Project",
"ScheduleStart": 1642501733,
"ScheduleEnd": 1642674533
}'
cURL example of changing the project name, moving it to archive named folder and changing status to finished.
Note that the project statuses can vary between EMMi instances
curl --location --request POST 'https://[EMMi instance]/papi/v1/project' \
--header 'Content-Type: application/json' \
--header 'x-auth-token: [Session token]' \
--data-raw '{
"Id": "123",
"ParentId":"206",
"StatusId": "8",
"Name": "My First Project - Done"
}'
Get Project by Id
Request : GET /papi/v1/project/[Project id]
Function for getting the basic information of a project.
Parameter | Parameter Type | Mandatory | Description |
---|---|---|---|
Project Id | Path | yes | Unique project id. |
x-auth-token | Header | yes | The authentication token must be provided as an x-auth-token header for every API request. More information about authentication token. |
Response: JSON – Project object.
{
"Id": "123",
"ParentId": "0",
"StatusId": "3",
"Name": "My First Project",
"ScheduleStart": 1642464000,
"ScheduleEnd": 1646092799,
"ScheduleFullDays": true,
"DeadlineNotification": false,
"Members": [
{
"ProjectRoleId": "1",
"UserId": "3",
"UserFullName": "John Average"
}
],
"PropertyValues": [
{
"FieldIdentifier": "81",
"Value": true
},
{
"FieldIdentifier": "82",
"Value": {
"x-default": "Lorem Brief."
}
}
],
"ProofCount": 1,
"AssetCount": 1,
"MessageCount": 1,
"Tasks": [
{
"Id": "204",
"ParentId": "123",
"Name": "My First Task",
"Description": "Do something",
"IsCompleted": false
}
],
"Milestones": [
{
"Id": "205",
"ParentId": "123",
"Name": "My First Milestone",
"Description": "When it's done, it will be",
"ScheduleEnd": 1645487999,
"ScheduleFullDays": true,
"DeadlineNotification": true
}
]
}
cURL example
curl --location --request POST 'https://[EMMi instance]/papi/v1/project/[Project id] \
--header 'x-auth-token: [Session token]'
Post your comment on this topic.