Gantt Chart Resource
Gantt Chart Resource endpoints
Creates a new Gantt Chart
Creates a new Gantt Chart for the specified structure.
URL: /gantt
Method: POST
Body Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
structureId | Number | Yes | The unique ID of the structure |
startDate | String | Yes | The start date for the Gantt chart |
name | String | No | The name of the newly created Gantt chart. This parameter is optional and will have null value by default. |
configId | Number | No | The ID of the configuration that will be used for the newly created Gantt chart. |
configName | String | No | The name of the configuration that will be used for the newly created Gantt chart. |
Examples:
curl -X POST --location "http://example.com/rest/structure-gantt/public/1.0/gantt/" \
-H "Content-Type: application/json" \
-d '{
"structureId": 12,
"startDate": "2023-12-20",
"name": "New Gantt",
"configId": "1"
}' \
--basic --user user:password
curl -X POST --location "http://example.com/rest/structure-gantt/public/1.0/gantt/" \
-H "Content-Type: application/json" \
-d '{
"structureId": 12,
"startDate": "2023-12-20",
"name": "New Gantt",
"configName": "Default"
}' \
--basic --user user:password
Responses
STATUS 200 application/json - returns baseline object.
Example
{
"id": 116,
"structureId": 12,
"startDate": "2023-12-20",
"configId": 1,
"configName": "Default",
"name": "New Gantt"
}
STATUS 404 application/json - error message if the structure doesn't exist or the user doesn't have permission to create a Gantt chart for the specified structure.
{
"message": "Structure #12 does not exist or you don't have permission to edit it"
}
STATUS 400 application/json - error message if a Gantt chart already exists for the specified structure.
{
"message": "Unable to create second main gantt"
}
STATUS 400 application/json - error message if both parameters configId and configName were passed to the request.
{
"message": "Specify either config name or config id, not both."
}
Get Gantt chart by ID
Retrieves information about the Gantt chart by its id.
URL: /gantt/{ganttId}
Method: GET
URL Parameters:
Parameter | Type | Description |
---|---|---|
ganttId | Number | The unique ID of the Gantt chart |
Example:
curl -X GET --location "http://example.com/rest/structure-gantt/public/1.0/gantt/116" \
-H "Content-Type: application/json" \
--basic --user user:password
Responses
STATUS 200 application/json - returns Gantt chart object.
Example
{
"id": 116,
"structureId": 12,
"startDate": "2023-12-20",
"configId": 1,
"configName": "Default",
"name": "New Gantt"
}
STATUS 404 application/json - error message if a Gantt chart with the specified ID doesn't exist or the user doesn't have permission to view this Gantt chart.
{
"message": "Gantt chart #111 does not exist or you don't have permission to view it"
}
Search Gantt charts
Returns Gantt charts based on the provided criteria. Without any input, it returns all available Gantt charts for the user.
If a structure ID is specified, returns the Gantt chart associated with that structure (name parameter will be ignored),
while providing a name will filter the Gantt charts to those matching the name.
URL: /gantt/
Method: GET
URL Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
structureId | Number | No | The unique ID of the structure |
name | String | No | Name of the Gantt chart to search |
Examples:
# Search by structureId
curl -X GET --location "http://example.com/rest/structure-gantt/public/1.0/gantt?structureId=12" \
-H "Content-Type: application/json" \
--basic --user user:password
# Search by name
curl -X GET --location "http://example.com/rest/structure-gantt/public/1.0/gantt?name=New%20Gantt%20name" \
-H "Content-Type: application/json" \
--basic --user user:password
# Get all available Gantt Charts
curl -X GET --location "http://example.com/rest/structure-gantt/public/1.0/gantt" \
-H "Content-Type: application/json" \
--basic --user user:password
Responses
STATUS 200 application/json - returns Gantt chart list matching the criteria.
Example
[
{
"id": 71,
"structureId": 10,
"startDate": "2024-01-04",
"configId": 1,
"configName": "Default"
},
{
"id": 118,
"structureId": 12,
"startDate": "2024-02-02",
"configId": 1,
"configName": "Default",
"name": "New Gantt name"
}
]
Update a Gantt chart
Updates a Gantt chart.
URL: /gantt/{ganttId}
Method: PUT
URL Parameters:
Parameter | Type | Description |
---|---|---|
ganttId | Number | The unique ID of the Gantt chart to be updated |
Body Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
startDate | String | No | The new start date for the Gantt chart |
name | String | No | The new name for the Gantt chart. |
configId | Number | No | The ID of the configuration that will be used after updating the Gantt chart. |
configName | String | No | The name of the configuration that will be used after updating the Gantt chart. |
Examples:
curl -X PUT --location "http://example.com/rest/structure-gantt/public/1.0/gantt/38" \
-H "Content-Type: application/json" \
-d '{
"startDate": "2023-12-15",
"name": "New name for Gantt Chart",
"configId": 1
}' \
--basic --user user:password
curl -X PUT --location "http://example.com/rest/structure-gantt/public/1.0/gantt/38" \
-H "Content-Type: application/json" \
-d '{
"startDate": "2023-12-15",
"name": "New name for Gantt Chart",
"configName": "Default"
}' \
--basic --user user:password
Responses
STATUS 200 application/json - returns the updated Gantt chart.
Example
{
"id": 38,
"structureId": 7,
"startDate": "2023-12-15",
"configId": 1,
"configName": "Default",
"name": "New name for Gantt Chart"
}
STATUS 400 application/json - error message if both parameters configId and configName were passed to the request.
{
"message": "Specify either config name or config id, not both."
}
STATUS 404 application/json - error message if a Gantt chart with the specified ID doesn't exist or if the user doesn't have permission to edit it.
{
"message": "Gantt chart #111 does not exist or you don't have permission to view it"
}
Remove Gantt chart
Remove Gantt chart with specified id.
URL: /gantt/{ganttId}
Method: DELETE
URL Parameters:
Parameter | Type | Description |
---|---|---|
ganttId | Number | The unique ID of the Gantt chart to be deleted |
Example:
curl -X DELETE --location "http://example.com/rest/structure-gantt/public/1.0/gantt/116" \
-H "Content-Type: application/json" \
--basic --user user:password
Responses
STATUS 202 application/json - response is empty if the Gantt chart was deleted successfully.
Example
STATUS 404 application/json - error message if a Gantt chart with the specified ID doesn't exist or the user doesn't have permission to delete the Gantt chart.
{
"message": "Gantt chart #111 does not exist or you don't have permission to view it"
}