how to fetch crash_reason_id and crash count for all the crash reasons under all versions

ritul's Avatar

ritul

15 Feb, 2017 08:14 PM

https://rink.hockeyapp.net/manage/apps/123/app_versions/124/crash_reasons/157323175
for above url, how to fetch crash_reason_id and then crash count under it?

  1. Support Staff 1 Posted by Shawn Dyas on 15 Feb, 2017 09:50 PM

    Shawn Dyas's Avatar

    Hi,

    I cannot open your link for privacy reasons, but the integer at the end of your url should be the ID of one of your crash groups.GET /api/2/apps/APP_ID/crash_reasons will return all crash groups for an app and also the ID's for each crash group. This ID can be used to list all crashes of a crash group and returns total_entries which will be crash count. Our example curl requests below.

    List crash groups for an app:

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

    Thanks,
    Shawn

  2. 2 Posted by Viewer on 16 Feb, 2017 06:17 PM

    Viewer's Avatar

    but this approach traverse all the app versions, but We want to capture list of crash groups for some predefined app versions. we have tried with version_id/crash_reasons as below but this does give any result,

    https://rink.hockeyapp.net/api/2/apps/f3b77c67df61ae1a988641ba05a123234/app_versions/123/crashes/search?page=1&sort=date&order=desc&per_page=100&query=created_at%3A%5B%222017-01-06T00%3A00%22+TO+%222017-02-16%22%5D&type=crashes

  3. Support Staff 3 Posted by Shawn Dyas on 16 Feb, 2017 06:35 PM

    Shawn Dyas's Avatar

    Hi,

    Instead of using the unique app id 3b77c67df61ae1a988641ba05a123234, you need to use the ID you'll see in the URL when you select your app from dashboard. For instance the value 406236 from this link https://rink.hockeyapp.net/manage/apps/406236.

    Thanks,
    Shawn

  4. 4 Posted by Viewer on 16 Feb, 2017 07:25 PM

    Viewer's Avatar

    all above curl example has appguid, why it has to be app id?
    I am trying to call above url from code to access crash group response as json format.
    IS the above formed url is correct as i do not see this API guide,
    As I am able to access it through appid as below,
    https://rink.hockeyapp.net/manage/apps/117923/app_versions/3165/crashes/search?page=2&per_page=50&query=created_at%3A%5B%222017-01-01T00%3A00%22+TO+%222017-02-16T23%3A59%22%5D&type=crashes

    but through code, not able to fetch any response.

  5. 5 Posted by Viewer on 16 Feb, 2017 07:31 PM

    Viewer's Avatar

    can you share example for calling GET /api/2/apps/APP_ID/app_versions/VERSION_ID/crash_reasons ?

  6. Support Staff 6 Posted by Shawn Dyas on 16 Feb, 2017 08:11 PM

    Shawn Dyas's Avatar

    Hi,

    An example below, you need to swap out the HockeyAppToken, APP_ID and VERSION_ID:

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

    Thanks,
    Shawn

  7. 7 Posted by Viewer on 22 Feb, 2017 03:39 PM

    Viewer's Avatar
  8. Support Staff 8 Posted by Shawn Dyas on 22 Feb, 2017 03:53 PM

    Shawn Dyas's Avatar

    Hi,

    No, it does not mean this, as documented:

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

    Thus you can specify 30 day blocks and will go back as far as you have crashes, provided you correctly specify 30 day blocks

    Thanks,
    Shawn

  9. 9 Posted by Viewer on 22 Feb, 2017 05:20 PM

    Viewer's Avatar

    ok, so is this correct usage?
    "https://rink.hockeyapp.net/api/2/apps/a5be7b1c2d9ef330e8248fc73a4eb4a4/app_versions/3193/crash_reasons/156875412/histogram?start_date=2017-02-11&end_date=2017-02-12"

    purpose is to extract crash count on a particular date per app_version per crash group

  10. Support Staff 10 Posted by Shawn Dyas on 22 Feb, 2017 05:44 PM

    Shawn Dyas's Avatar

    Hi,

    Yes, this is the correct syntax to search for the number of crashes in a crashgroup in a specific version on a particular date range. I have also confirmed by testing now.

    Thanks,
    Shawn

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac