Errors

This endpoint returns a list of individual errors, sorted by date descending.

Url

GET https://api.trackjs.com/{CUSTOMER_ID}/v1/errors

Parameters

The following parameters may be specified on the query string to further filter the results. All parameters shown here are optional.

Date Range

startDate: Default value if not specified is the beginning of time. We accept any ISO-8601 formatted date string. Time precision is within 1 second. That is, you may feel free to specify very specific start dates.

endDate: Default value if not specified is the current date and time. We accept any ISO-8601 formatted date string. Time precision is within 1 second. That is, you may feel free to specify very specific end dates.

GET https://api.trackjs.com/{CUSTOMER_ID}/v1/errors?startDate=2016-07-01&endDate=2016-07-30T19%3A45%3A19Z

Paging

By default the endpoint returns the most recent 20 results. You may adjust the number of results, and also specify a different page, if the number of total results exceed what you’ve requested.

page The page of data you’re requesting. Default value is 1 if not specified.

size The number of results to return per request. The default value is 20. The maximum value is 1000.

GET https://api.trackjs.com/{CUSTOMER_ID}/v1/errors?page=1&size=100

Stack Trace

By default we do not include the stack trace in the error payload as it can be very large. However, should you wish to see the stack trace for each error, you may include the following flag.

includeStack Set this value to true or True to have the stack trace returned with the rest of the error payload.

GET https://api.trackjs.com/{CUSTOMER_ID}/v1/errors?includeStack=true

The payload will contain a stackTrace property which is an array of strings. The stack trace is unprocessed except for splitting on newlines (\n).

Applications

If you make use of multiple applications, you specify which application key you’d like to receive data for.

application The application key to request data for. If not specified you will receive all data for all applications.

GET https://api.trackjs.com/{CUSTOMER_ID}/v1/errors?application=Prod

Example

Request

GET https://api.trackjs.com/{CUSTOMER_ID}/v1/errors?startDate=2014-09-01&size=3&includeStack=true

Response

{

    "data": [
        {
            "message": "test",
            "timestamp": "2014-09-24T23:53:08+00:00",
            "url": "https://my.trackjs.com/",
            "id": "5d893bd8c50346fe9b97af36af530f2d",
            "browserName": "Firefox",
            "browserVersion": "32.0",
            "entry": "direct",
            "line": 40,
            "column": 213,
            "file": "https://d2zah9y47r7bi2.cloudfront.net/awesome.js",
            "userId": "",
            "sessionId": "",
            "trackJsUrl": "https://my.trackjs.com/details/5d893bd8c50346fe9b97af36af530f2d",
            "stackTrace": [
              "ReferenceError: data is not defined",
              " at HTMLDocument.<anonymous> (https://my.trackjs.com/daily?date=2016-07-23:387:41)",
              " at c (https://my.trackjs.com/js/lib/jquery/jquery-1.10.2.min.js:4:26036)",
              " at Object.fireWith [as resolveWith] (https://my.trackjs.com/js/lib/jquery/jquery-1.10.2.min.js:4:26840)",
              " at Function.ready (https://my.trackjs.com/js/lib/jquery/jquery-1.10.2.min.js:4:3305)",
              " at HTMLDocument.q (https://my.trackjs.com/js/lib/jquery/jquery-1.10.2.min.js:4:717)"
            ],
            "metadata": [{
                "key": "subscription",
                "value": "Professional"
              },{
                "key": "machine",
                "value": "NS-456-235"
            }]
        },
        {
            "message": "$.pjax.defaults is undefined",
            "timestamp": "2014-09-24T21:31:02+00:00",
            "url": "https://my.trackjs.com/customer/login?returnUrl=%2f",
            "id": "d2a46cfdaf23470ba49ca427925d8584",
            "browserName": "Internet Explorer",
            "browserVersion": "8.0",
            "entry": "window",
            "line": 1,
            "file": "https://my.trackjs.com/js/scripts?v=5y-koHtQDYMRnmEVmYCrKDMepSsVMbT6sKJLDcxLUdw1",
            "userId": "",
            "sessionId": "",
            "trackJsUrl": "https://my.trackjs.com/details/d2a46cfdaf23470ba49ca427925d8584",
            "metadata": [{
                "key": "locale",
                "value": "en-US"
              },{
                "key": "machine",
                "value": "NS-456-235"
            }]
        },
        {
            "message": "404 Not Found",
            "timestamp": "2014-09-24T19:12:17+00:00",
            "url": "https://my.trackjs.com/customer/login?returnUrl=%2f",
            "id": "1bc554ceebbd407cb90b877a9efbd099",
            "browserName": "Chrome",
            "browserVersion": "37.0.2062",
            "entry": "ajax",
            "userId": "",
            "sessionId": "",
            "trackJsUrl": "https://my.trackjs.com/details/1bc554ceebbd407cb90b877a9efbd099"
        }
    ],
    "metadata": {
        "startDate": "2014-09-11T00:00:00Z",
        "totalCount": 193,
        "page": 1,
        "size": 3,
        "hasMore": true,
        "trackJsUrl": "https://my.trackjs.com/recent"
    }

}