Skip to main content
Skip table of contents

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:

ParameterTypeRequiredDescription
structureIdNumberYesThe unique ID of the structure
startDateStringYesThe start date for the Gantt chart
nameStringNoThe name of the newly created Gantt chart. This parameter is optional and will have null value by default.
configIdNumberNo

The ID of the configuration that will be used for the newly created Gantt chart.
This should be used if you wish to specify the configuration by its unique identifier.
This parameter cannot be used together with configName.

configNameStringNo

The name of the configuration that will be used for the newly created Gantt chart.
Use this if you prefer to specify the configuration by its name.
This parameter cannot be used together with configId.

Examples:

BASH
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
BASH
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
JS
{
  "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.
JS
{
  "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.
JS
{
  "message": "Unable to create second main gantt"
}
STATUS 400 application/json - error message if both parameters configId and configName were passed to the request.
JS
{
  "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:

ParameterTypeDescription
ganttIdNumberThe unique ID of the Gantt chart

Example:

BASH
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
JS
{
  "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.
JS
{
  "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:

ParameterTypeRequiredDescription
structureIdNumberNoThe unique ID of the structure
nameStringNoName of the Gantt chart to search

Examples:

BASH
# 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
JS
[  
  {
    "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:

ParameterTypeDescription
ganttIdNumberThe unique ID of the Gantt chart to be updated

Body Parameters:

ParameterTypeRequiredDescription
startDateStringNoThe new start date for the Gantt chart
nameStringNoThe new name for the Gantt chart.
configIdNumberNo

The ID of the configuration that will be used after updating the Gantt chart.
This should be used if you wish to specify the configuration by its unique identifier.
This parameter cannot be used together with configName.

configNameStringNo

The name of the configuration that will be used after updating the Gantt chart.
Use this if you prefer to specify the configuration by its name.
This parameter cannot be used together with configId.

Examples:

BASH
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
BASH
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
JS
{
  "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.
JS
{
  "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.
JS
{
  "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:

ParameterTypeDescription
ganttIdNumberThe unique ID of the Gantt chart to be deleted

Example:

BASH
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.
JS
{
  "message": "Gantt chart #111 does not exist or you don't have permission to view it"
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.