Developer Documentation

Reference table of contents

Getting started

To make a call to the api and receive a list of Traffic management plans together with all their data you can simply make a call to

api.tmpforchch.co.nz/v2/tmps?key=<your api key>

replacing <your api key> with the api key we have provided you. You will be returned JSON data that looks similar to

response: "200 OK", tmps: [ { id: "13152", companyname: "Fletcher Construction Company Christchurch", reference: "Scirt 10812 Slater St Nth TMP-060", title: "SCIRT Sewer Repairs", ... } ], _metadata: [ { totalCount: "57", limit: "20", offset: "0" } ]

API access

You are required to provide an API key anytime you access the TMP API.

Getting an API key

Head over to request an api key and fill out the form. We will send you an api key as soon as we have approved your access. Once you have an api key it can be used in api calls by adding it to the url

Specific example

key=<your api key>

In context example

api.tmpforchch.co.nz/v2/tmps?key=<your api key>

Versioning

An api version must be supplied via the url when api calls are made. From time to time we may modify the api. When we do that we will create a new api version so that old versions continue to work. The current version is '2' and should be specified prefixed with 'v'

Specific example

v2

In context example

api.tmpforchch.co.nz/v2/tmps

Ordering

You may specify how you would like the results ordered when they are returned

Limit

You may specify how many results you would like to receive

e.g.api.tmpforchch.co.nz/v2/tmps?key=<your api key>&limit=1000

Partial response

You may specify what data you are interested to filter out unwanted data in the response

Date range

You may specify a date range in which to fetch results from.

e.g.http://api.tmpforchch.co.nz/v2/tmps?key=<your api key>&startdate=2013-05-08&enddate=2013-05-15&limit=10000

Tips

Partial response

In some cases using partial response will improve the speed in which you get back results from the api.