Online Gantt Chart API Documentation

Available API Actions

Email me: chris@gantto.com to receive your API credentials

Gantto’s Online Gantt Chart API makes it easy to render an interactive Gantt Chart from your custom scheduling data.

Here is our list of supported API commands, and the corresponding responses. These examples are shown in the form of ‘curl’ commands. Curl is a command line utility used to perform HTTP requests, and is available on most Unix systems, but you can use any tool or language which can submit a corresponding HTTP request.

Hosts

Email me: chris@gantto.com to receive your API credentials

The api is hosted:

https://api.gantto.com

Available API Actions

Load API token:

Email me: chris@gantto.com to receive your API credentials

curl -u $username:$password -X GET $host/api/token

Sample response:

<?xml version="1.0" encoding="UTF-8"?>
<token>
  <uid>123456789abcdef</uid>
</token>

Get the sample project

This sample project illustrates how to build up tasks, summaries, resources and assignments by way of example. No authorization is required.

curl -X GET $host/api/services/v0/projects/sample

Sample response:

<?xml version="1.0" encoding="UTF-8"?>
<GanttoProject>
  ...
</GanttoProject>

View the sample project

This project shows the example project, including one dynamically loaded summary

$host/api_client/gantto.html#cmd=api_read_only&file_id=f23f0e403a5c418291e3a4968eae6833

Create a read-only gantt-chart

To render the chart, first you push the xml project, and then you load the resulting url.

curl -H "X-GanttoToken:$token" -H "Content-type: application/xml" \
-X POST -d "<GanttoXML>...</GanttoXML>" $host/api/services/projects

Sample response:

<?xml version="1.0" encoding="UTF-8"?>
<project>
  <url>https://api.gantto.com/api_client/gantto.html#cmd=api_read_only&file_id=123456789abcdef</url>
</project>

Read back the file sent over (for testing purposes):

curl -H "X-GanttoToken:$token" -X GET $host/api/services/projects/$linkUID

Sample response:

<?xml version="1.0" encoding="UTF-8"?>
<ganttoXML>
  ...
</ganttoXML>

Embed Gantto into an iframe :

<iframe width="1200" height="800" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="$url"></iframe>

Get children of dynamically loaded summary:

Crossdomain files

Note: In order for Gantto to make this crossdomain api calls, a crossdomain file must be in pace at the root of your api service. If this is not setup properly, Gantto will popup an error complaining of a missing crossdomain file.

For instance https://my.host.com/crossdomain.xml would contain:

<cross-domain-policy>
  <!--If your host is a secure (https) host-->
  <allow-access-from domain="$host"/>
  <!--If your host is not a secure (https) host-->
  <allow-access-from secure="false" domain="$host"/>
  <site-control permitted-cross-domain-policies="master-only"/>
</cross-domain-policy>

External API Authentication Token

For the dynamic summaries any authentication token should be included as a url parameter (to avoid the process of specifying custom headers in the XML document.) These should be https calls and they are not visible to the end user.

curl -X GET $externalHost/api/summaries/123456?$token=$secret

Dynamic Summaries

The Gantto client will make http(s) get calls to an external API to learn what additional nodes shall be placed under the calling dynamic summary.

The following command illustrates the syntax, including new resources and assignments, by way of example:

curl -X GET $host/api/services/v0/summaries/sample

Sample response:

<?xml version="1.0" encoding="UTF-8"?>
<Summary>
  <task>
    ...
  </task>
    ...
</Summary>

Gantto project XML syntax

Tasks

<Task>
  <UID>FCB98AD5-3294-E4D9-C8EE-C27795F9CA3F</UID>
     uid’s need to be in this 36 character format and need to be unique across the project
  <Name>C</Name>
  <Critical>0</Critical>
      1 for on the critical path, 0 for not
  <Milestone>0</Milestone>
      1 for is milestone, 0 if not
  <Summary>0</Summary>
      1 for is a summary, 0 if not
  <IsNull>0</IsNull>
      1 for is an empty task, 0 if not
  <PercentComplete>0</PercentComplete>
      float
  <Notes/>
      String
  <Start>2012-03-12T08:00:00</Start>
      Start dates are rounded up to the next available working time
  <Finish>2012-03-16T17:00:00</Finish>
      End dates are rounded down to the previous available working time
  <OutlineNumber>3</OutlineNumber>
      For specifying indentation, Like work break down structure.  1,2,2.1,2.2,2.3,3,4,5 etc.
  <color>1</color>
      See below
  <PredecessorLink>
    <PredecessorUID>ABD5911B-D4FE-7EF4-CD5D-C279553EFB4C</PredecessorUID>
        The uid of the task preceding this one.  Gantto does not currently support cyclic or over constrained dependencies
      <Type>1</Type>
        We only support type 1 which is finish to start
    </PredecessorLink>
  </Task>
close