Get the stack trace for an error in your app

Use this method in the Microsoft Store analytics API to get the stack trace for an error in your app. This method can only download the stack trace for an app error that occurred in the last 30 days. Stack traces are also available in the Failures section of the Health report in Partner Center.

Before you can use this method, you must first use the get details for an error in your app method to retrieve the ID of the CAB file that is associated with the error for which you want to retrieve the stack trace.

Prerequisites

To use this method, you need to first do the following:

  • If you have not done so already, complete all the prerequisites for the Microsoft Store analytics API.
  • Obtain an Azure AD access token to use in the request header for this method. After you obtain an access token, you have 60 minutes to use it before it expires. After the token expires, you can obtain a new one.
  • Get the ID of the CAB file that is associated with the error for which you want to retrieve the stack trace. To get this ID, use the get details for an error in your app method to retrieve details for a specific error in your app, and use the cabId value in the response body of that method.

Request

Request syntax

Method Request URI
GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/stacktrace

Request header

Header Type Description
Authorization string Required. The Azure AD access token in the form Bearer <token>.

Request parameters

Parameter Type Description Required
applicationId string The Store ID of the app for which you want to get the stack trace. The Store ID is available on the App identity page in Partner Center. An example Store ID is 9WZDNCRFJ3Q8. Yes
cabId string The unique ID of the CAB file that is associated with the error for which you want to retrieve the stack trace. To get this ID, use the get details for an error in your app method to retrieve details for a specific error in your app, and use the cabId value in the response body of that method. Yes

 

Request example

The following example demonstrates how to get a stack trace using this method. Replace the applicationId value with the Store ID for your app.

GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/stacktrace?applicationId=9NBLGGGZ5QDR&cabId=1336373323853 HTTP/1.1
Authorization: Bearer <your access token>

Response

Response body

Value Type Description
Value array An array of objects that each contain one frame of stack trace data. For more information about the data in each object, see the stack trace values section below.
@nextLink string If there are additional pages of data, this string contains a URI that you can use to request the next page of data. For example, this value is returned if the top parameter of the request is set to 10 but there are more than 10 rows of errors for the query.
TotalCount integer The total number of rows in the data result for the query.

Stack trace values

Elements in the Value array contain the following values.

Value Type Description
level string The frame number that this element represents in the call stack.
image string The name of the executable or library image that contains the function that is called in this stack frame.
function string The name of the function that is called in this stack frame. This is available only if your app includes symbols for the executable or library.
offset string The byte offset of the current instruction relative to the start of the function.

Note

This method can only download the stack trace for an app error that occurred in the last 30 days.

Request and Response example

The following code snippets demonstrates some example request and JSON response body for those request.

Sample Request

GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/stacktrace?applicationId=9NBLGGGZ5QDR&cabId=1234567890123456789
HTTP/1.1
Authorization: Bearer <your access token>

Sample Response

{
    "Value": [
        {
            "level": "0",
            "image": "Microsoft.Contoso",
            "function": "HANG_QUIESCE",
            "offset": "0x0000000000000000",
            "isBlamedFrame": true
        },
        {
            "level": "1",
            "image": "unknown.dll",
            "function": "[.ecxr]",
            "offset": "0x0000000000000000",
            "isBlamedFrame": false
        },
        {
            "level": "2",
            "image": "ntdll.dll",
            "function": "RtlpHpSegFree",
            "offset": "0x0000000000000000",
            "isBlamedFrame": false
        },
        {
            "level": "3",
            "image": "ntdll.dll",
            "function": "RtlpHpFreeHeap",
            "offset": "0x0000000000000000",
            "isBlamedFrame": false
        },
        {
            "level": "4",
            "image": "ntdll.dll",
            "function": "RtlpFreeHeapInternal",
            "offset": "0x0000000000000000",
            "isBlamedFrame": false
        }
    ],
    "TotalCount": 5
}