GETTING STARTED WITH THE API
To get started with the PLAN-R API:
- Ask your system administrator for the URL of the service that provides the API, usually https://your-org.domain/public-api/;
- Find the unique identifier of the space you will work with;
- Create an access token.
Checking API Service Availability
Check the network address hosting the API.
$ ping your-org.domain
Pinging your-org.domain [10.10.21.99] with 32 bytes of data:
Reply from 10.10.21.99: bytes=32 time=15ms TTL=57
Reply from 10.10.21.99: bytes=32 time=15ms TTL=57
Reply from 10.10.21.99: bytes=32 time=15ms TTL=57
Reply from 10.10.21.99: bytes=32 time=15ms TTL=57
Ping statistics for 10.10.21.99:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 15ms, Maximum = 15ms, Average = 15ms
Check the URL hosting the API.
$ curl https://your-org.domain/public-api/
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 158 0 158 0 0 2166 0 --:--:-- --:--:-- --:--:-- 2225
{
"error":
{
"message":"Token isn't exists",
"details":"Please check that exist Authorization token fo your request",
"instance":"/public-api/ http method - GET"
}
}
Retrieve your first data:
curl -X 'GET' \
'https://your-org.domain/public-api/eps' \
-H 'Authorization: your-api-key' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'x-tenant-id: cc8b0762-f600-4e59-9d0c-190b69113da0'
[
{
"id": "cc8b0762-f600-4e59-9d0c-190b69113da0",
"name": "Your Organization Space Name,
"parentId": null,
"sortOrder": null,
"type": "space",
"createdBy": null,
"createdAt": "2024-06-21T15:24:01.758297"
}
]
Working with the Enterprise Project Structure
Suppose your space has just been created and contains no data. Retrieve the initial state of the EPS.
curl -X 'GET' \
'https://your-org.domain/public-api/eps' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad'
The response contains a list of EPS nodes. Since only the space exists initially, the list contains a single node of type space.
[
{
"id": "5db13376-ba5c-4fd5-ba7f-dc56347956ad",
"name": "Your Organization",
"parentId": null,
"sortOrder": 0,
"type": "space",
"createdBy": "0efee9db-a3ff-4d89-b560-dc000b1eb246",
"createdAt": "2024-02-27T11:04:25.635368"
}
]
Enterprise Project Structure in the web client
Let's create your enterprise structure within the space. Add the first Facility, specifying the existing space as its parent. Set the new node's type to facility.
curl -X 'POST' \
'https://your-org.domain/public-api/eps' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad' \
-H 'Content-Type: application/json;odata.metadata=minimal;odata.streaming=true' \
-d '{
"type": "facility",
"name": "Low-Rise Construction",
"parentId": "5db13376-ba5c-4fd5-ba7f-dc56347956ad"
}'
Create another Facility.
curl -X 'POST' \
'https://your-org.domain/public-api/eps' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad' \
-H 'Content-Type: application/json;odata.metadata=minimal;odata.streaming=true' \
-d '{
"type": "facility",
"name": "Industrial Building Construction",
"parentId": "5db13376-ba5c-4fd5-ba7f-dc56347956ad"
}'
Retrieve the updated EPS:
curl -X 'GET' \
'https://your-org.domain/public-api/eps' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad'
[
{
"id": "5db13376-ba5c-4fd5-ba7f-dc56347956ad",
"name": "Your Organization",
"parentId": null,
"sortOrder": 0,
"type": "space",
"createdBy": "0efee9db-a3ff-4d89-b560-dc000b1eb246",
"createdAt": "2024-02-27T11:04:25.635368"
},
{
"id": "b60f984c-0088-4d57-992b-853e0fbcbf5e",
"name": "Industrial Building Construction",
"parentId": "5db13376-ba5c-4fd5-ba7f-dc56347956ad",
"sortOrder": 1,
"type": "facility",
"createdBy": "0efee9db-a3ff-4d89-b560-dc000b1eb246",
"createdAt": "2024-06-27T12:22:47.195"
},
{
"id": "df11cea2-effa-419a-bd5f-cd6ce3985fd9",
"name": "Low-Rise Construction",
"parentId": "5db13376-ba5c-4fd5-ba7f-dc56347956ad",
"sortOrder": 0,
"type": "facility",
"createdBy": "0efee9db-a3ff-4d89-b560-dc000b1eb246",
"createdAt": "2024-06-27T12:22:33.603"
}
]
Note: Populate the EPS according to the PLAN-R data model (see Data Model).
Enterprise Project Structure in the web client after creating Facilities
After creating the Facilities, add projects and schedules to the EPS.
curl -X 'POST' \
'https://your-org.domain/public-api/eps' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad' \
-H 'Content-Type: application/json;odata.metadata=minimal;odata.streaming=true' \
-d '{
"type": "project",
"name": "Warehouse Complex Construction",
"parentId": "d39ed93d-c3b0-4111-92f4-d489692f4fe4"
}'
{
"id": "e1a12c3f-0d88-49ed-aab9-fe83f61cdeef",
"name": "Warehouse Complex Construction",
"parentId": "b60f984c-0088-4d57-992b-853e0fbcbf5e",
"sortOrder": 0,
"type": "project",
"createdBy": "0efee9db-a3ff-4d89-b560-dc000b1eb246",
"createdAt": "2024-06-27T12:36:56.511"
}
curl -X 'POST' \
'https://your-org.domain/public-api/eps' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad' \
-H 'Content-Type: application/json;odata.metadata=minimal;odata.streaming=true' \
-d '{
"type": "schedule",
"name": "Material Delivery Schedule",
"parentId": "e1a12c3f-0d88-49ed-aab9-fe83f61cdeef"
}'
{
"id": "54faa898-fbdc-43fe-80e6-3811c2955ffe",
"name": "Delivery Schedule",
"parentId": "923a4075-6de8-4a1c-a5ee-070604dac07e",
"sortOrder": 0,
"type": "schedule",
"createdBy": "0efee9db-a3ff-4d89-b560-dc000b1eb246",
"createdAt": "2024-06-27T12:40:36.961"
}
Enterprise Project Structure in the web client after creating projects and schedules
Rename the schedule to "Construction Schedule".
curl -X 'PUT' \
'https://your-org.domain/public-api/eps/54faa898-fbdc-43fe-80e6-3811c2955ffe' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad' \
-H 'Content-Type: application/json;odata.metadata=minimal;odata.streaming=true' \
-d '{
"name": "Construction Schedule",
}'
Add a new version to the schedule.
curl -X 'POST' \
'https://your-org.domain/public-api/eps' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad' \
-H 'Content-Type: application/json;odata.metadata=minimal;odata.streaming=true' \
-d '{
"type": "version",
"name": "Actual",
"parentId": "54faa898-fbdc-43fe-80e6-3811c2955ffe"
}'
{
"id": "9fc1c418-1a9a-48e6-9395-791e0ebd3b99",
"name": "Actual",
"parentId": "36b60d7c-fba9-4fb6-8d5a-a054f2043827",
"sortOrder": 0,
"type": "version",
"createdBy": "0efee9db-a3ff-4d89-b560-dc000b1eb246",
"createdAt": "2024-06-27T13:11:03.533"
}
Enterprise Project Structure in the web client after creating projects, schedules, and schedule versions
Working with Work Breakdown Structure Attributes
PLAN-R uses Work Breakdown Structure attributes to store information about activity parameters in the WBS. Attributes are associated with a specific EPS node and inherited by all descendant nodes. For example, an attribute created for a project is available in all schedules belonging to that project.
There are two types of attributes:
- System — attributes initially present in the system and associated with the space;
- User-defined — attributes created by users that can be associated with Facilities, projects, or schedules.
Note: Attribute types and purposes are described in Data Model.
Retrieve the list of attributes for the space by setting epsId to the space identifier.
curl -X 'GET' \
'https://your-org.domain/public-api/wbs-attributes?epsId=5db13376-ba5c-4fd5-ba7f-dc56347956ad' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad'
The response contains a list of attributes:
[
{
"id": "0cc9baf7-229b-452d-bc35-40abcf6d57d2",
"epsId": "5db13376-ba5c-4fd5-ba7f-dc56347956ad",
"label": "ID",
"type": "string",
"directoryId": null,
"directoryAttributeId": null
},
{
"id": "12519af0-a0d7-4a6b-b9db-3cb40f9df880",
"epsId": "5db13376-ba5c-4fd5-ba7f-dc56347956ad",
"label": "Progress",
"type": "number",
"directoryId": null,
"directoryAttributeId": null
},
..........
]
Create a new user-defined attribute of type date in the space. This attribute will be available on all descendant EPS nodes.
curl -X 'POST' \
'https://your-org.domain/public-api/wbs-attributes' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad' \
-H 'Content-Type: application/json;odata.metadata=minimal;odata.streaming=true' \
-d '{
"epsId": "5db13376-ba5c-4fd5-ba7f-dc56347956ad",
"label": "Documentation Release Date",
"type": "date",
}'
Working with the Work Breakdown Structure
Retrieve the Work Breakdown Structure for a schedule version.
curl -X 'GET' \
'https://your-org.domain/public-api/wbs?epsId=bc1da5df-d644-461a-aa54-e60182195898' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad'
The response is an empty list because no activities have been added to the schedule version yet.
[]
To create the first activities in the WBS, retrieve the unique identifiers of the "ID", "Name", "Start", and "Finish" attributes for the schedule version.
curl -X 'GET' \
'https://your-org.domain/public-api/wbs-attributes?epsId=bc1da5df-d644-461a-aa54-e60182195898&filter=label in ('ID', 'Start', 'Finish', 'Name')' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad'
[
{
"id": "0cc9baf7-229b-452d-bc35-40abcf6d57d2",
"epsId": "5db13376-ba5c-4fd5-ba7f-dc56347956ad",
"label": "ID",
"type": "string",
"directoryId": null,
"directoryAttributeId": null
},
{
"id": "b9a15773-bea1-4038-9a4c-7f7dccc85b52",
"epsId": "5db13376-ba5c-4fd5-ba7f-dc56347956ad",
"label": "Name",
"type": "string",
"directoryId": null,
"directoryAttributeId": null
},
{
"id": "cd58507a-dece-47d8-b4a9-690eabad0536",
"epsId": "5db13376-ba5c-4fd5-ba7f-dc56347956ad",
"label": "Finish",
"type": "date",
"directoryId": null,
"directoryAttributeId": null
},
{
"id": "d347e9d9-cd63-44d1-9091-a3f01232da96",
"epsId": "5db13376-ba5c-4fd5-ba7f-dc56347956ad",
"label": "Start",
"type": "date",
"directoryId": null,
"directoryAttributeId": null
}
]
Add the first activity:
curl -X 'POST' \
'https://your-org.domain/public-api/wbs' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad' \
-H 'Content-Type: application/json;odata.metadata=minimal;odata.streaming=true' \
-d '{
"epsId": "bc1da5df-d644-461a-aa54-e60182195898",
"parentId": "bc1da5df-d644-461a-aa54-e60182195898",
"type": "task",
"code": "S001",
"name": "Excavation for the Foundation Pit"
}'
{
"id": "43b87cce-0695-4b57-bcd2-9b3345f9275a",
"parentId": "bc1da5df-d644-461a-aa54-e60182195898",
"code": "S001",
"type": "task",
"level": 0,
"indexNumber": 0,
"sortOrder": 0,
"values": {
"0cc9baf7-229b-452d-bc35-40abcf6d57d2": "S001",
"12519af0-a0d7-4a6b-b9db-3cb40f9df880": 0,
"30447676-52e9-4f7e-8891-1cce5b4cc029": "5304a040-7b58-4e94-b7b6-d543a6df9291",
"3dafdd41-566a-4671-b354-f5180d295ec4": 0,
"6ecddbe3-3b5c-4a3d-96f4-c48ede50ec4a": "not_started",
"727e66e5-f8c3-4c14-b3cc-ff319d2d153f": "plan-r",
"85e1278a-00e9-4ea3-9220-190dbb9aa2d9": "atest atest atest@test.ru",
"ae0bbb2f-6ec0-4893-87bf-1002b2a57130": 5,
"b34be140-35c4-4833-b7cc-ded3edf50f0d": 40,
"b9a15773-bea1-4038-9a4c-7f7dccc85b52": "Excavation for the Foundation Pit",
"c7e1fba8-2dbd-4a2c-93e2-23d58b010118": 1720015593480,
"cd58507a-dece-47d8-b4a9-690eabad0536": 1720375200000,
"d2342704-ae8e-4584-90b0-b61d5bacc400": 40,
"d347e9d9-cd63-44d1-9091-a3f01232da96": 1719997200000,
"dfff9bfb-a77b-4c89-af4a-b41c942d126f": "earlier",
"f8d748cf-53fb-4d14-89c0-f1d2d708d44f": 40
},
"criticalPath": false,
"materialPath": null,
"curatorAccepted": false
}
Add a WBS node:
curl -X 'POST' \
'https://your-org.domain/public-api/wbs' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad' \
-H 'Content-Type: application/json;odata.metadata=minimal;odata.streaming=true' \
-d '{
"epsId": "bc1da5df-d644-461a-aa54-e60182195898",
"parentId": "bc1da5df-d644-461a-aa54-e60182195898",
"type": "work",
"name": "Foundation Construction"
}'
{
"id": "2b73a1f8-833f-488c-9947-7fc1a4b76310",
"parentId": "bc1da5df-d644-461a-aa54-e60182195898",
"code": "100",
"type": "work",
"level": 0,
"indexNumber": 1,
"sortOrder": 1,
"values": {
"0cc9baf7-229b-452d-bc35-40abcf6d57d2": "100",
"727e66e5-f8c3-4c14-b3cc-ff319d2d153f": "plan-r",
"b9a15773-bea1-4038-9a4c-7f7dccc85b52": "Foundation Construction"
},
"criticalPath": false,
"materialPath": null,
"curatorAccepted": false
}
Add more activities to the node:
curl -X 'POST' \
'https://your-org.domain/public-api/wbs' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad' \
-H 'Content-Type: application/json;odata.metadata=minimal;odata.streaming=true' \
-d '{
"epsId": "bc1da5df-d644-461a-aa54-e60182195898",
"parentId": "2b73a1f8-833f-488c-9947-7fc1a4b76310",
"type": "task",
"name": "Rebar Installation"
}'
{
"id": "90bdc497-b6d0-41cf-a9a9-9621c8bd0732",
"parentId": "2b73a1f8-833f-488c-9947-7fc1a4b76310",
"code": "A100",
"type": "task",
"level": 1,
"indexNumber": 2,
"sortOrder": 0,
"values": {
"0cc9baf7-229b-452d-bc35-40abcf6d57d2": "A100",
"12519af0-a0d7-4a6b-b9db-3cb40f9df880": 0,
"30447676-52e9-4f7e-8891-1cce5b4cc029": "5304a040-7b58-4e94-b7b6-d543a6df9291",
"3dafdd41-566a-4671-b354-f5180d295ec4": 0,
"6ecddbe3-3b5c-4a3d-96f4-c48ede50ec4a": "not_started",
"727e66e5-f8c3-4c14-b3cc-ff319d2d153f": "plan-r",
"85e1278a-00e9-4ea3-9220-190dbb9aa2d9": "atest atest atest@test.ru",
"ae0bbb2f-6ec0-4893-87bf-1002b2a57130": 5,
"b34be140-35c4-4833-b7cc-ded3edf50f0d": 40,
"b9a15773-bea1-4038-9a4c-7f7dccc85b52": "Rebar Installation",
"c7e1fba8-2dbd-4a2c-93e2-23d58b010118": 1720016385055,
"cd58507a-dece-47d8-b4a9-690eabad0536": 1720375200000,
"cda6b4ec-3d70-4c72-b728-c7af59606612": "100",
"d2342704-ae8e-4584-90b0-b61d5bacc400": 40,
"d347e9d9-cd63-44d1-9091-a3f01232da96": 1719997200000,
"dfff9bfb-a77b-4c89-af4a-b41c942d126f": "earlier",
"f8d748cf-53fb-4d14-89c0-f1d2d708d44f": 40
},
"criticalPath": false,
"materialPath": "2b73a1f8-833f-488c-9947-7fc1a4b76310",
"curatorAccepted": false
}
curl -X 'POST' \
'https://your-org.domain/public-api/wbs' \
-H 'accept: application/json;odata.metadata=minimal;odata.streaming=true' \
-H 'x-version: 409' \
-H 'Authorization: your-api-key' \
-H 'x-tenant-id: 5db13376-ba5c-4fd5-ba7f-dc56347956ad' \
-H 'Content-Type: application/json;odata.metadata=minimal;odata.streaming=true' \
-d '{
"epsId": "bc1da5df-d644-461a-aa54-e60182195898",
"parentId": "2b73a1f8-833f-488c-9947-7fc1a4b76310",
"type": "task",
"name": "Concrete Placement"
}'
{
"id": "2d68dc0b-3877-4ed3-ac1c-9dcfa519df3f",
"parentId": "2b73a1f8-833f-488c-9947-7fc1a4b76310",
"code": "A110",
"type": "task",
"level": 1,
"indexNumber": 2,
"sortOrder": 1,
"values": {
"0cc9baf7-229b-452d-bc35-40abcf6d57d2": "A110",
"12519af0-a0d7-4a6b-b9db-3cb40f9df880": 0,
"30447676-52e9-4f7e-8891-1cce5b4cc029": "5304a040-7b58-4e94-b7b6-d543a6df9291",
"3dafdd41-566a-4671-b354-f5180d295ec4": 0,
"6ecddbe3-3b5c-4a3d-96f4-c48ede50ec4a": "not_started",
"727e66e5-f8c3-4c14-b3cc-ff319d2d153f": "plan-r",
"85e1278a-00e9-4ea3-9220-190dbb9aa2d9": "atest atest atest@test.ru",
"ae0bbb2f-6ec0-4893-87bf-1002b2a57130": 5,
"b34be140-35c4-4833-b7cc-ded3edf50f0d": 40,
"b9a15773-bea1-4038-9a4c-7f7dccc85b52": "Concrete Placement",
"c7e1fba8-2dbd-4a2c-93e2-23d58b010118": 1720016482952,
"cd58507a-dece-47d8-b4a9-690eabad0536": 1720375200000,
"cda6b4ec-3d70-4c72-b728-c7af59606612": "100",
"d2342704-ae8e-4584-90b0-b61d5bacc400": 40,
"d347e9d9-cd63-44d1-9091-a3f01232da96": 1719997200000,
"dfff9bfb-a77b-4c89-af4a-b41c942d126f": "earlier",
"f8d748cf-53fb-4d14-89c0-f1d2d708d44f": 40
},
"criticalPath": false,
"materialPath": "2b73a1f8-833f-488c-9947-7fc1a4b76310",
"curatorAccepted": false
}
WBS in the web client