取得應用程式的錯誤報告資料

在 Microsoft Store 分析 API 中使用此方法,取得您的應用程式在指定日期範圍和其他選擇性篩選條件的 JSON 格式彙總錯誤報告資料。 此方法只能擷取過去 30 天內發生的錯誤。 此資訊也可在合作夥伴中心健康情況報告的 [失敗] 區段中取得。

您可以使用取得錯誤詳細資料取得堆疊追蹤,以及下載 CAB 檔案方法來擷取其他錯誤資訊。

必要條件

要使用此方法,您需要先執行以下操作:

  • 如果您尚未執行此操作,請完成 Microsoft Store 分析 API 的所有必要條件
  • 取得 Azure AD 存取權杖以便用於此方法的要求標頭中。 取得存取權杖之後,您在其到期之前有 60 分鐘的時間可以使用。 權杖到期之後,您可以取得新的權杖。

要求

要求語法

方法 要求 URI
GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/failurehits

要求標頭

標題 類型 描述
授權 字串 必要。 持有人<權杖>形式的 Azure AD 存取權杖。

要求參數

參數 類型 描述 必要
applicationId 字串 您想要擷取錯誤報告資料之應用程式 Store ID。 Store ID 可在合作夥伴中心的應用程式識別頁面上取得。 範例 Store ID 為 9WZDNCRFJ3Q8。
startDate date 要擷取錯誤報告資料之日期範圍的開始日期。 預設值是目前的日期。 如果 aggregationLeveldayweekmonth,此參數應該以 mm/dd/yyyy 格式指定日期。 如果 aggregationLevelhour,這個參數就能以 mm/dd/yyyy 格式指定日期,或 yyyy-mm-dd hh:mm:ss 格式指定日期和時間。

注意:此方法只能擷取過去 30 天內發生的錯誤。
endDate date 要擷取錯誤報告資料之日期範圍的結束日期。 預設值是目前的日期。 如果 aggregationLeveldayweekmonth,此參數應該以 mm/dd/yyyy 格式指定日期。 如果 aggregationLevelhour,這個參數就能以 mm/dd/yyyy 格式指定日期,或 yyyy-mm-dd hh:mm:ss 格式指定日期和時間。
熱門 int 要求中要傳回的資料列數。 如果未指定,則最大值和預設值為 10000。 如果查詢中有更多資料列,回應本文會包含下一個連結,您可以用來要求下一頁的資料。
skip int 要在查詢中忽略的列數。 使用此參數逐頁瀏覽大型資料集。 例如,top=10000 和 skip=0 會擷取前 10000 列資料,top=10000 和 skip=10000 會擷取接下來的 10000 列資料,依此類推。
篩選器 字串 篩選回應中的資料列的一或多個陳述式。 每個陳述式都包含回應本文的功能變數名稱,以及與 eqne 運算子相關聯的值,而且可以使用 andor 結合陳述式。 字串值必須以 filter 參數中的單引號括住。 您可以從回應本文指定下列功能變數:

  • applicationName
  • failureName
  • failureHash
  • 符號
  • osVersion
  • osRelease
  • eventType
  • market
  • deviceType
  • packageName
  • packageVersion
  • date
aggregationLevel 字串 指定要擷取彙總資料的時間範圍。 可以是下列其中一個字串:hourdayweekmonth。 如果未指定,則預設值為 day。 如果您指定 weekmonth,failureName 和 failureHash 值會限制為 1000 個儲存貯體。

注意:如果您指定 hour,則只能擷取前 72 小時的錯誤資料。 若要擷取超過 72 小時的錯誤資料,請指定 day 或其他彙總層級之一。
orderby 字串 排序結果資料值的陳述式。 語法為 orderby=field [order],field [order],...。field 參數可以是下列其中一個字串:
  • applicationName
  • failureName
  • failureHash
  • 符號
  • osVersion
  • osRelease
  • eventType
  • market
  • deviceType
  • packageName
  • packageVersion
  • date

order 參數是選擇性的,而且可以是 ascdesc,以指定每個欄位的遞增或遞減順序。 預設為asc

以下是範例 orderby 字串:orderby=date,market

groupby 字串 僅將資料彙總套用至指定欄位的陳述式。 您可以指定下列功能變數:
  • failureName
  • failureHash
  • 符號
  • osVersion
  • eventType
  • market
  • deviceType
  • packageName
  • packageVersion

傳回的資料列將包含 groupby 參數中指定的欄位,以及下列項目:

  • date
  • applicationId
  • applicationName
  • deviceCount
  • eventCount

groupby 參數可以搭配 aggregationLevel 參數使用。 例如:&groupby=failureName,market&aggregationLevel=week

要求範例

下列範例示範數個取得錯誤報告資料的要求。 以您應用程式的 Store ID 取代 applicationId 值。

GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/failurehits?applicationId=9NBLGGGZ5QDR&startDate=1/1/2015&endDate=2/1/2015&top=10&skip=0 HTTP/1.1
Authorization: Bearer <your access token>

GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/failurehits?applicationId=9NBLGGGZ5QDR&startDate=8/1/2015&endDate=8/31/2015&skip=0&filter=market eq 'US' and deviceType eq 'phone' HTTP/1.1
Authorization: Bearer <your access token>

回應

回應本文

類型 描述
陣列 物件的陣列,其中包含彙總錯誤報告資料。 如需關於每個物件中的資料的詳細資訊,請參閱下方的錯誤值一節。
@nextLink 字串 如果有額外的資料頁面,此字串會包含可用來要求下一頁資料的 URI。 例如,如果要求的 top 參數設定為 10000,但查詢的錯誤超過 10000 個資料列,則會傳回此值。
TotalCount 整數 查詢的資料結果中的總列數。

錯誤值

Value 陣列中的元素包含下列值。

類型 描述
date 字串 錯誤資料之日期範圍中的第一個日期,格式為 yyyy-mm-dd。 如果要求指定單天,這個值就是該日期。 如果要求指定較長的日期範圍,這個值就是該日期範圍中的第一個日期。 針對 aggregationLevel 值指定 hour 的要求,這個值也包含格式為 hh:mm:ss 的時間值。
applicationId 字串 您想要擷取錯誤資料之應用程式 Store ID。
applicationName 字串 應用程式的顯示名稱。
failureName 字串 失敗的名稱,由四個部分組成:一或多個問題類別、例外狀況/錯誤檢查代碼、發生失敗的映像名稱,以及相關聯的函式名稱。
failureHash 字串 錯誤的唯一識別碼。
符號 字串 指派給此錯誤的符號。
osVersion 字串 下列其中一個字串,指定發生錯誤的 OS 版本:
  • Windows Phone 7.5
  • Windows Phone 8
  • Windows Phone 8.1
  • Windows Phone 10
  • Windows 8
  • Windows 8.1
  • Windows 10
  • Windows 11
  • Unknown
osRelease 字串 下列其中一個字串,指定發生錯誤的 OS 版本或發行小眾測試版通道 (作為 OS 版本內的子群體)。

若為 Windows 11:2110 版

若為 Windows 10:

  • 1507 版
  • 1511 版
  • 1607 版
  • 1703 版
  • 1709 版
  • 1803 版
  • Release Preview
  • Insider Fast
  • Insider Slow

若是 Windows Server 1709:

  • RTM

若是 Windows Server 2016:

  • 1607 版

若為 Windows 8.1:

  • Update 1

若為 Windows 7:

  • Service Pack 1

如果 OS 版本或發行小眾測試版通道不明,此功能變數的值為 Unknown

eventType 字串 下列其中一個字串:
  • crash
  • hang
  • memory
  • jse
market 字串 裝置市場的 ISO 3166 國家/地區代碼。
deviceType 字串 下列其中一個字串,指出發生錯誤的裝置類型:
  • PC
  • 手機
  • Console-Xbox One
  • Console-Xbox Series X
  • IoT
  • Holographic
  • Unknown
packageName 字串 與此錯誤相關聯之應用程式套件的唯一名稱。
packageVersion 字串 與此錯誤相關聯之應用程式套件的版本。
deviceCount 針對指定的彙總層級,對應至此錯誤的唯一裝置數目。
eventCount 針對指定的彙總層級,歸因於此錯誤的事件數目。

注意

此方法只能擷取過去 30 天內發生的錯誤。

要求和回應範例

下列程式碼片段示範這些要求的範例要求和 JSON 回應本文。

範例要求

GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/failurehits?applicationId=9NBLGGGZ5QDR&startDate=07/02/2022&endDate=07/20/2022&top=10&skip=0&filter=market eq 'US'&groupby=failureName,failureHash,symbol,osVersion,eventType,market,deviceType,packageName,packageVersion,osRelease&orderby=date
HTTP/1.1
Authorization: Bearer <your access token>

範例回應

{
    "Value": [
        {
            "date": "2022-07-21",
            "applicationId": "9NBLGGGZ5QDR",
            "applicationName": "Contoso Demo",
            "failureName": "APPLICATION_HANG_BlockedOn_FileIO_Microsoft.Contoso Demo!CEServices.InternalLiveTileUpdaterRuntime_dfffffff_Microsoft.Contoso Demo!unknown_error_in_application",
            "failureHash": "c21da75f-ea4d-538b-cfec-73654ef810b9",
            "symbol": "Microsoft.Contoso Demo!unknown_error_in_application",
            "osVersion": "6.3.9600",
            "osRelease": "RTM",
            "osArchitecture": null,
            "eventType": "hang",
            "market": "US",
            "deviceType": "PC",
            "praid": null,
            "packageName": "microsoft.Contoso Demo_2.5.2.34894_x86__8wekyb3d8bbwe",
            "packageVersion": "2.5.2.34894",
            "ram": null,
            "massStorage": null,
            "cpu": null,
            "cpuManufacturer": null,
            "cpuFamilyName": null,
            "sandboxId": null,
            "deviceCount": 6.0,
            "eventCount": 1.05263157894737
        },
        {
            "date": "2022-07-21",
            "applicationId": "9NBLGGGZ5QDR",
            "applicationName": "Contoso Demo",
            "failureName": "APPLICATION_HANG_BlockedOn_FileIO_Microsoft.Contoso Demo!CEServices.InternalLiveTileUpdaterRuntime_dfffffff_Microsoft.Contoso Demo!unknown_error_in_application",
            "failureHash": "c21da75f-ea4d-538b-cfec-73654ef810b9",
            "symbol": "Microsoft.Contoso Demo!unknown_error_in_application",
            "osVersion": "6.3.9600",
            "osRelease": "RTM",
            "osArchitecture": null,
            "eventType": "hang",
            "market": "US",
            "deviceType": "Unknown",
            "praid": null,
            "packageName": "microsoft.Contoso Demo_2.5.2.34894_x86__8wekyb3d8bbwe",
            "packageVersion": "2.5.2.34894",
            "ram": null,
            "massStorage": null,
            "cpu": null,
            "cpuManufacturer": null,
            "cpuFamilyName": null,
            "sandboxId": null,
            "deviceCount": 7.14285714285714,
            "eventCount": 1.05263157894737
        },
        {
            "date": "2022-07-21",
            "applicationId": "9NBLGGGZ5QDR",
            "applicationName": "Contoso Demo",
            "failureName": "APPLICATION_HANG_Microsoft.Contoso Demo!CEServices.InternalLiveTileUpdaterRuntime_dfffffff_twinapi.appcore.dll!WaitCoalesced",
            "failureHash": "233e04bb-7a3d-eb28-c316-1120aa9defc0",
            "symbol": "twinapi.appcore.dll!WaitCoalesced",
            "osVersion": "6.3.9600",
            "osRelease": "RTM",
            "osArchitecture": null,
            "eventType": "hang",
            "market": "US",
            "deviceType": "PC",
            "praid": null,
            "packageName": "microsoft.Contoso Demo_2.5.2.34894_x86__8wekyb3d8bbwe",
            "packageVersion": "2.5.2.34894",
            "ram": null,
            "massStorage": null,
            "cpu": null,
            "cpuManufacturer": null,
            "cpuFamilyName": null,
            "sandboxId": null,
            "deviceCount": 6.0,
            "eventCount": 8.94736842105263
        }
    ],
    "@nextLink": "failurehits?applicationId=9NBLGGGZ5QDR&aggregationLevel=day&startDate=2022/07/02&endDate=2022/07/21&top=10&skip=10&groupby=failureName,failureHash,symbol,osVersion,eventType,market,deviceType,packageName,packageVersion,osRelease&filter=market eq 'US'&orderby=date",
    "TotalCount": 443
}