Overview
In this article, you’ll find tutorials on importing and managing Gantt tasks via the PlanRadar API, including importing schedules with phases and tasks, and updating individual Gantt phases or tasks.
Find other tutorials in Open API Overview > API Tutorials.
Import Gantt Tasks
With PlanRadar APIs, you can import Gantt tasks ‘schedule including phases and tasks',
using the API:
POST /api/v2/{customer_id}/projects/{project_id}/gantt_tasks/import
for uploading the file, the body is of type: multipart/form-data
and uploaded to the parameter : data[attributes][file]
-form 'data[attributes][file]=@"{{file-path}}"'
in case of success request:
the response will have the status code : 204No Content
and the process for importing will be done synchronously in the background.
Gantt - Update Phase/Task
With PlanRadar APIs, you can Update Phase/Task,
using the API:
PUT /api/v2/{customer_id}/projects/{project_id}/gantt_tasks/{id}
the {id} is the phase/task id you want to update.
and here is a sample request for each attachment type:
{
"data": {
"attributes": {
"title": "string",
"start_date": "string",
"end_date": "string",
"parent_id": "string", // Phase id to set the phase as a sub phase
"duration": 0,
"auto": true,
"task_order": 0, // Order of the task/phase in the same level of the tree
"progress": 0,
"has_custom_progress": true
}
}
}
in case of success request:
the response will have the phase/task data as shown in the below response :
{
"data": {
"id": "ogbgyxx",
"type": "gantt-tasks",
"attributes": {
"id": "ogbgyxx",
"title": "new Title",
"start-date": "2024-12-05",
"end-date": "2024-12-18",
"uuid": "6bc87c73-4e85-4f56-a20b-62575e1a46e2",
"path": "1",
"task-order": 1,
"taskable-id": null,
"taskable-type": null,
"status": "active",
"progress": 0,
"has-custom-progress": false,
"auto": true,
"duration": 10,
"expected-start-date": null,
"expected-end-date": null,
"parent-id": null,
"customer-id": "kkdzpd",
"project-id": "pyxpew",
"user-id": "lmqjnkn",
"depth": 1,
"has-conflict": false
},
"relationships": {
"taskable": {
"data": null
},
"successors": {
"data": []
},
"predecessors": {
"data": []
}
}
}
}
Comments
0 comments
Please sign in to leave a comment.