Body font Header font  
Print

Tiktrac REST API

Overview

The Tiktrac API is XML or JSON over HTTP. Simply set the following headers to inform Tiktrac you want to use XML:

Accept: application/xml
Content-Type: application/xml

Accept: application/x-json
Content-Type: application/x-json

The examples in this document use curl, a command line utility.

Authentication

Basic HTTP authentication is required to access the API. Ensure that you use the URL for your account (Tiktrac accounts have their own subdomain.)

Methods

Sheet list

curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://helicoid.tiktrac.com/sheets -u alex@example.com:password

Task list

Provide a sheet ID in the URL to get a list of tasks for that sheet.

curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://helicoid.tiktrac.com/sheets/2/tasks -u alex@example.com:password

Update task

Provide the ID of the task you wish to update in the URL. A list of attributes you wish to update must be provided as an XML string. You can update more than one attribute at once.

Set duration

curl -X PUT -d '<task><duration>3</duration></task>' -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://helicoid.tiktrac.com/tasks/7098 -u alex@example.com:password

Set status

curl -X PUT -d '<task><state>completed</state></task>' -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://helicoid.tiktrac.com/tasks/6834 -u alex@example.com:password

Task creation

Specify the required sheet ID in the XML sent to the server:

curl -X POST -d '<task><sheet_id>1</sheet_id><duration>3</duration><description>This is some work I performed</description></task>' -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://helicoid.tiktrac.com/tasks -u alex@example.com:password

Error reporting

Task update/create errors are reported like this:

<errors>
  <error>Description is too long (maximum is 1000 characters)</error>
  <error>Description can't be blank</error>
</errors>

JavaScript example

The following example is a rough JavaScript class showing how to use the API. This could be used to construct a Dashboard widget. It requires Prototype to work correctly.

Download: http://tiktrac.com/tiktrac_api.js