API: Crashes

This Developer API lets you list crash groups, list crashes, download logs and description, getting a histogram, or post custom crash reports. All endpoints require authentication with an API token with the exception of posting custom crash reports.

Reference

The following strings need to be replaced with the values for your apps:

  • APP_ID: The unique identifier for your app. You can get it from your app page on HockeyApp or through the List of Apps API, field "public_identifier".

  • VERSION_ID: The internal identifier for a version in the HockeyApp database. You can get it through the List Versions API.

  • CRASH_REASON_ID: The internal identifier for a crash group in the HockeyApp database. You can get it through the List Crash Groups API.

List Crash Groups

List all crash groups for an app:

GET /api/2/apps/APP_ID/crash_reasons

List all crash groups for a version:

GET /api/2/apps/APP_ID/app_versions/VERSION_ID/crash_reasons

Parameters:

  • page - optional, used for pagination

  • per_page - optional, the number of items to be present in the response (25, 50, 100); default is 25

Parameters (only available for version endpoint since 1/1/2016):

  • symbolicated - optional, set to 1 if you only want crashes that have run through the symbolication process

  • sort - optional, sort by "date" (default), "class", "number_of_crashes", "last_crash_at"

  • order - optional, "asc" for ascending order (default) or "desc" for descending order

Example:

curl \
  -H "X-HockeyAppToken: 4567abcd8901ef234567abcd8901ef23" \
  "https://rink.hockeyapp.net/api/2/apps/1234567890abcdef1234567890abcdef/crash_reasons?symbolicated=1&page=1"

Response:

Status: 200
Body:
{
    "crash_reasons": [
      {
          "id": 456,
          "app_id": 123,
          "app_version_id": 91,
          "number_of_crashes": 948,
          "created_at": "2011-10-18T16:59:03Z",
          "updated_at": "2011-10-19T19:38:10Z",
          "last_crash_at": "2011-10-19T19:35:02Z",
          "bundle_short_version": "1.0",
          "bundle_version":"90",
          "status": 1,
          "fixed": true,
          "file":"main.m"
          "class": "-",
          "method": "main",
          "line": "5",
          "reason": "*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 1. The number of rows contained in an existing section after the update (1) must be equal to the number of rows contained in that section before the update (0), plus or minus the number of rows inserted or deleted from that section (0 inserted, 0 deleted).'",
      },

      ...
    ],
    "total_entries": 78,
    "total_pages": 4,
    "per_page": 25,
    "status": "success",
    "current_page": 1
}

The crash groups are paginated with a maximum of 25/50/100 crashes per page. The value of "total_entries" is the total number of groups, the value of "total_pages" is the total number of pages.

List of Crashes in Crash Group

List all crashes of a crash group.

GET /api/2/apps/APP_ID/crash_reasons/ID

Parameters:

  • page - optional, used for pagination

  • per_page - optional, the number of items to be present in the response (25, 50, 100); default is 25

Example:

curl \
  -H "X-HockeyAppToken: 4567abcd8901ef234567abcd8901ef23" \
  https://rink.hockeyapp.net/api/2/apps/1234567890abcdef1234567890abcdef/crash_reasons/789?page=1

Response:

Status: 200
Body:
{
    "crashes": [
        {
            "id": 9,
            "app_id": 123,
            "app_version_id": 456,
            "crash_reason_id": 789,
            "created_at": "2011-05-02T12:08:10Z",
            "updated_at": "2011-05-02T13:01:36Z",
            "oem": "Apple",
            "model": "iPhone3,1",
            "bundle_version": "89",
            "bundle_short_version": "1.0",
            "contact_string": ""
            "user_string": "",
            "os_version": "4.3.2",
            "jail_break": false,
        },

        ...
    ],
    "total_entries": 72,
    "total_pages": 3,
    "per_page": 25,
    "status": "success",
    "current_page": 1
}

The crashes are paginated with a maximum of 25/50/100 crashes per page. The value of "total_entries" is the total number of crashes, the value of "total_pages" is the total number of pages.

Download Log and Description

This API lets you query a single crash log, its meta data, or the description.

GET /api/2/apps/APP_ID/crashes/ID

Parameters:

  • format - required, set to "log" for the crash log, to "json" for the meta data, and to "text" for the description

Example:

curl \
  -L -H "X-HockeyAppToken: 4567abcd8901ef234567abcd8901ef23" \
  https://rink.hockeyapp.net/api/2/apps/1234567890abcdef1234567890abcdef/crashes/123?format=log

Histogram

Get a histogram of the number of crashes between two given dates…

…for an app:

GET /api/2/apps/APP_ID/crashes/histogram

…for a version:

GET /api/2/apps/APP_ID/app_versions/VERSION_ID/crashes/histogram

…for a crash group:

GET api/2/apps/APP_ID/crash_reasons/CRASH_REASON_ID/histogram

Parameters:

  • start_date - required, set to YYYY-MM-DD

  • end_date - required, set to YYYY-MM-DD

Then number of days between start_date and end_date should not be larger as 30 days. If it is, the last 30 days before end_date are returned (effectively ignoring start_date).

Example:

curl \
  -H "X-HockeyAppToken: 4567abcd8901ef234567abcd8901ef23" \
  "https://rink.hockeyapp.net/api/2/apps/1234567890abcdef1234567890abcdef/crashes/histogram?start_date=2013-06-01&end_date=2013-06-15"

Response:

Status: 200
Body:
{
  "status": "success",
  "histogram": [
    [
      "2013-06-01",
      321
    ],
    [
      "2013-06-02",
      345
    ],
    [
      "2013-06-03",
      234
    ],    
    ...
  ]
}

Search Crashes

Search for crashes by query string…

…for an app:

GET /api/2/apps/APP_ID/crashes/search

…for a version:

GET /api/2/apps/APP_ID/app_versions/VERSION_ID/crashes/search

Parameters:

  • query - required, for the format see help text in the web search UI

Example:

curl \
  -H "X-HockeyAppToken: 4567abcd8901ef234567abcd8901ef23" \
  "https://rink.hockeyapp.net/api/2/apps/1234567890abcdef1234567890abcdef/crashes/search?query=os_version:6*"

Search Crash Groups

Search for crash groups by query string…

…for an app:

GET /api/2/apps/APP_ID/crash_reasons/search

…for a version:

GET /api/2/apps/APP_ID/app_versions/VERSION_ID/crash_reasons/search

Parameters:

  • query - required, for the format see help text in the web search UI

Example:

curl \
  -H "X-HockeyAppToken: 4567abcd8901ef234567abcd8901ef23" \
  "https://rink.hockeyapp.net/api/2/apps/1234567890abcdef1234567890abcdef/crash_reasons/search?query=cmethod:objectAtIndex"

Update Group Status & Ticket

Set the status of a crash group or assign a ticket URL.

POST /api/2/apps/APP_ID/crash_reasons/ID

Parameters:

  • status - optional, set to 0 for open, 1 for resolved, 2 for ignored
  • ticket_url - optional, set to URL for a ticket in your bug tracker

Example:

curl -F "status=1" \
     -F "ticket_url=https://github.com/bitstadium/HockeyApp/issues/15" \
     -H "X-HockeyAppToken: 4567abcd8901ef234567abcd8901ef23" \
     https://rink.hockeyapp.net/api/2/apps/1234567890abcdef1234567890abcdef/crash_reasons/23

Post Custom Crashes

Post a crash report, e.g. if you don't want to use our SDK or develop for a custom platform.

POST /api/2/apps/APP_ID/crashes/upload

Parameters:

  • log - required, file with the crash log - Note: The maximum allowed file size is 200kB!

  • description - optional, file with optional information, e.g. excerpts from the system log

  • attachment0 - optional, file with optional binary data (3 attachments allowed, change the index accordingly)

  • userID - optional, string with a user or device ID, limited to 255 chars

  • contact - optional, string with contact information, limited to 255 chars

Example:

curl \
  -F "log=@crash.log" \
  -F "description=@description.txt" \
  -F "attachment0=@some.dat" \
  -F "userID=1234567890" \
  -F "contact=thomas@dohmke.de" \
  https://rink.hockeyapp.net/api/2/apps/1234567890abcdef1234567890abcdef/crashes/upload

The crash log should be formatted as follows:

Package: PACKAGE NAME
Version: VERSION 
OS: OS VERSION
Manufacturer: DEVICE OEM
Model: DEVICE MODEL
Date: DATETIME
CrashReporter Key: APP INSTALLATION UUID

EXCEPTION REASON STRING
  at CLASS.METHOD(FILE:LINE)
  at CLASS.METHOD(FILE:LINE)
  at CLASS.METHOD(FILE:LINE)
  at CLASS.METHOD(FILE:LINE)
  at CLASS.METHOD(FILE:LINE)
  at CLASS.METHOD(FILE:LINE)
  at CLASS.METHOD(FILE:LINE)
  at CLASS.METHOD(FILE:LINE)
  at CLASS.METHOD(FILE:LINE)
ANOTHER EXCEPTION REASON STRING
  at CLASS.METHOD(FILE:LINE)
  at CLASS.METHOD(FILE:LINE)
  at CLASS.METHOD(FILE:LINE)
  at CLASS.METHOD(FILE:LINE)

An example looks like this:

Package: de.codenauts.hockeyapp
Version: 33
OS: 2.2
Manufacturer: HTC
Model: HTC Desire
Date: Sun Nov 27 17:35:08 GMT+01:00 2011
CrashReporter Key: 1C6ADE7f-643E-A5F3-5CBF-E496CE21DEAA218624AF

java.lang.RuntimeException: Unable to start activity ComponentInfo{de.codenauts.hockeyapp/de.codenauts.hockeyapp.MainActivity}: java.lang.NullPointerException
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2787)
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803)
  at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4066)
  at android.app.ActivityThread.access$2400(ActivityThread.java:135)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2140)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:144)
  at android.app.ActivityThread.main(ActivityThread.java:4937)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:521)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
  at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:112)
  at org.json.JSONTokener.nextValue(JSONTokener.java:90)
  at org.json.JSONArray.<init>(JSONArray.java:87)
  at org.json.JSONArray.<init>(JSONArray.java:103)
  at de.codenauts.hockeyapp.MainActivity.loadApps(MainActivity.java:137)
  at de.codenauts.hockeyapp.MainActivity.onCreate(MainActivity.java:66)
  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069)
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751)
  ... 12 more

Note that the value in PACKAGE NAME must match the bundle identifier set for the app on HockeyApp.
Also note that the CrashReporter Key value should be a UUID that identifies the app installation anonymously on a device and can be used to calculate impacted users for a crash group.

Annotations

Retrieve the annotation of a crash group:

GET /api/2/apps/APP_ID/crash_reasons/CRASH_REASON_ID/crash_annotations

Update the annotation of a crash group:

POST /api/2/apps/APP_ID/crash_reasons/CRASH_REASON_ID/crash_annotations

Delete the annotation of a crash group:

DELETE /api/2/apps/APP_ID/crash_reasons/CRASH_REASON_ID/crash_annotations

Parameters:

  • text - optional, the new annotation text