Capitan API Documentation

Overview

The Capitan API allows programmatic access to Capitan data. API users with the requisite permissions may retrieve information, edit fields, and create new records.

Collections

The Capitan API supports a large number of REST collections, including the following:

Authentication

All Capitan API endpoints require authentication. Two methods are supported: session and token auth. Session auth is intended to allow a convenient login workflow for the documentation and browsable API, and is not recommended for programmatic use.

Obtaining a token

Your token may be obtained via a POST request to the /get-token/ endpoint:

Request
POST https://api.hellocapitan.com/api/get-token/
{
  "username": "<username>",
  "password": "<password>"
}

Response
200 OK
{
  "token": "<token-string>"
}

Authenticating a request

In order to authenticate an API request, the token must be placed in the Authorization header. The token must be prefixed with the string "Token " ("Token", followed by one space), as in the following example:

Authorization: Token <token-string>

Filtering

List query results can be filtered through the use of URL parameters. All filtering uses case-insensitive substring matching to match fields, unless otherwise noted. For example, the following request would return active event types:

GET https://api.hellocapitan.com/api/event-types/?status=act

See the collection pages for information regarding which fields a collection may be filtered on.

Pagination

When performing a GET request on a collection, pagination is supported via the page URL parameter, or by following the next and previous fields in the JSON response. By default, collections are listed in groups of 10, but a custom page size up to 100 may be specified using the page_size URL parameter. For example, the following request would return events 101-200:

GET https://api.hellocapitan.com/api/events/?page=2&page_size=100