NAV
cURL

Introduction

Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database.

We have language bindings in Shell, Ruby, Python, and JavaScript! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

This example API documentation page was created with Slate. Feel free to edit it and use it as a base for your own API's documentation.

Authentication

To authorize, use this code:

require 'kittn'

api = Kittn::APIClient.authorize!('meowmeowmeow')
import kittn

api = kittn.authorize('meowmeowmeow')
# With shell, you can just pass the correct header with each request
curl "api_endpoint_here" \
  -H "Authorization: meowmeowmeow"
const kittn = require('kittn');

let api = kittn.authorize('meowmeowmeow');

Make sure to replace meowmeowmeow with your API key.

Kittn uses API keys to allow access to the API. You can register a new Kittn API key at our developer portal.

Kittn expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: meowmeowmeow

Links

Get a list of links

Request Endpoint

curl -g "https://api.terminusapp.com/v1/projects/prj_WBNZOsw154/links" -X GET \
    -u your_api_key:

GET /v1/projects/:project_id/links

Parameters

Name Description
project_id required Project ID
items Number of items to be returned. This can range between 1 and 100, and the default is 10.
page Specify the page number if there are items more than that can be returned in one request.
filter[created_at_gteq] Return items created after a certain date in YYYY-MM-DD format
filter[updated_at_gteq] Return items updated after a certain date in YYYY-MM-DD format

Response

{
  "data": [
    {
      "id": 3087,
      "url": "https://www.example.com/",
      "long_url": "https://www.example.com/?coupon=50p_off&cid=mkt_1234&utm_source=linkedin&utm_medium=social&utm_campaign=summer_promotion",
      "description": "Blog links",
      "campaign": {
        "value": "summer_promotion",
        "fields_map": [

        ],
        "parameter_format_id": null
      },
      "medium": {
        "value": "social",
        "fields_map": [

        ],
        "parameter_format_id": null
      },
      "source": {
        "value": "linkedin",
        "fields_map": [

        ],
        "parameter_format_id": null
      },
      "content": null,
      "term": null,
      "created_at": 1605052800,
      "short_url": {
        "clicks": 0,
        "url": "https://shor.ty/nflfsl"
      },
      "labels": [
        {
          "name": "urgent"
        },
        {
          "name": "blog"
        }
      ],
      "custom_parameter_values": [
        {
          "value": "50p_off",
          "fields_map": [

          ],
          "parameter_format_id": null,
          "custom_parameter": {
            "name": "coupon"
          }
        },
        {
          "value": "mkt_1234",
          "fields_map": [

          ],
          "parameter_format_id": null,
          "custom_parameter": {
            "name": "cid"
          }
        }
      ],
      "info_field_values": [
        {
          "value": "Bob Smith",
          "info_field": {
            "name": "Requester"
          }
        },
        {
          "value": "Buy Now",
          "info_field": {
            "name": "Ad Headline"
          }
        }
      ],
      "created_by": {
        "email": "abc@example.com"
      }
    }
  ],
  "meta": {
    "page": 1,
    "has_more": false
  }
}

Parameter Formats

List all Parameter Formats

Request Endpoint

curl -g "https://api.terminusapp.com/v1/projects/prj_RHxj7XgWv3/parameter_formats" -X GET \
    -u your_api_key:

GET /v1/projects/:project_id/parameter_formats

Parameters

Name Description
project_id required Project ID
items Number of items to be returned. This can range between 1 and 100, and the default is 10.
page Specify the page number if there are items more than that can be returned in one request.

Response

{
  "data": [
    {
      "id": 118,
      "name": "Email Campaign Format",
      "separator": "-",
      "created_at": 1605052800,
      "created_by": {
        "email": "abc@example.com"
      }
    }
  ],
  "meta": {
    "page": 1,
    "has_more": false
  }
}
Name Description
data An array of requested items
meta[page] Current page number
meta[has_more] Is true if there are more items to be retrieved

Projects

Get a list of projects

Request Endpoint

curl -g "https://api.terminusapp.com/v1/projects/" -X GET \
    -u your_api_key:

GET /v1/projects/

Parameters

Name Description
items Number of items to be returned. This can range between 1 and 100, and the default is 10.
page Specify the page number if there are items more than that can be returned in one request.

Response

{
  "data": [
    {
      "id": "prj_v0qktJKPzP",
      "name": "My project",
      "created_at": 1605052800,
      "created_by": {
        "email": "abc@example.com"
      }
    }
  ],
  "meta": {
    "page": 1,
    "has_more": false
  }
}