Documentation

REST API

Trackets uses a simple RESTful JSON API. Errors can be captured by simply sending a POST request to the right URL with the right data, as we'll see described shortly. The clients for different languages provided by Trackets use the same API as described here. If you're on one of the platforms where we don't yet have an official client, you can build one yourself by using this API.

The main API endpoint is https://trackets.com. Currently we only provide an API for creating new errors reports, which is described below. Every API request must be authorized with a project API key (available on the project settings page.)

Here's a sample request for creating a new error report by sending a HTTP POST request to the /reports/:api_key URL. The data is encoded using JSON and content type set to application/json. If you forget to set a proper content type, you'll get back a 400 error response.

POST https://trackets.com/api/reports/your_api_key

{
"error": {
"message": "Something went wrong",
"file_name": "app/models/error.rb",
"line_number": 43
}
}

Our API uses HTTPS to keep everything secure. The API key should be the public API key of the project. If the API key is missing or invalid, a 401 response is returned.

Parameter format

Here's a list of all of the parameters currently supported by the API.

message

required string

A short message describing the error.

stacktrace

optional string

Stacktrace for the error.

file_name

optional string

File name where the error occured.

line_number

optional number

Line number where the error occured.

column_number

optional number

Column number where the error occured.

type

optional string

Language description, currently supported values are ruby and javascript.

language

optional string

Language of the client where the error occured. This is mostly useful for capturing JavaScript errors where each client might have different language settings.

url

optional string

URL of the page where the error occured.

user_agent

optional string

User agent of the client's browser.

environment

optional string

Environment where the error was captured. The default value for this field is production. Errors can be filtered based on the environment.

custom_data

optional json

Every error can contain arbitrary JSON data to make its diagnosis easier. You can include any data you'd like, be it the user's email, account number, current subscription, or just any other diagnostic data that might be relevant.

Feedback