获取桌面应用程序的见解数据Get insights data for your desktop application

在 Microsoft Store analytics API 中使用此方法获取与已添加到 Windows 桌面应用程序的桌面应用程序的运行状况指标相关的见解数据。Use this method in the Microsoft Store analytics API to get insights data related to health metrics for a desktop application that you have added to the Windows Desktop Application program. 此数据也可用于合作伙伴中心桌面应用程序的 运行状况报告This data is also available in the Health report for desktop applications in Partner Center.

必备条件Prerequisites

若要使用此方法,首先需要执行以下操作:To use this method, you need to first do the following:

  • 完成 Microsoft Store 分析 API 的所有先决条件(如果尚未这样做)。If you have not done so already, complete all the prerequisites for the Microsoft Store analytics API.
  • 获取 Azure AD 访问令牌,以供在此方法的请求标头中使用。Obtain an Azure AD access token to use in the request header for this method. 获取访问令牌后,在它到期前,你有 60 分钟的使用时间。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.

请求Request

请求语法Request syntax

方法Method 请求 URIRequest URI
GETGET https://manage.devcenter.microsoft.com/v1.0/my/analytics/desktop/insights

请求头Request header

标头Header 类型Type 描述Description
授权Authorization 字符串string 必需。Required. Azure AD 访问令牌的格式为 Bearer <token> 。The Azure AD access token in the form Bearer <token>.

请求参数Request parameters

参数Parameter 类型Type 描述Description 必需Required
applicationIdapplicationId 字符串string 要获取其见解数据的桌面应用程序的产品 ID。The product ID of the desktop application for which you want to get insights data. 若要获取桌面应用程序的产品 ID,请在合作伙伴中心 ((例如运行状况报告中打开适用于桌面应用程序的分析报告,) 并从 URL 中检索产品 ID。To get the product ID of a desktop application, open any analytics report for your desktop application in Partner Center (such as the Health report) and retrieve the product ID from the URL. 如果未指定此参数,响应正文将包含注册到你的帐户的所有应用的 insights 数据。If you do not specify this parameter, the response body will contain insights data for all apps registered to your account. No
startDatestartDate 日期date 要检索的 insights 数据的日期范围的开始日期。The start date in the date range of insights data to retrieve. 默认值为当前日期之前 30 天。The default is 30 days before the current date. No
endDateendDate 日期date 要检索的 insights 数据的日期范围的结束日期。The end date in the date range of insights data to retrieve. 默认值为当前日期。The default is the current date. No
filterfilter 字符串string 在响应中筛选行的一条或多条语句。One or more statements that filter the rows in the response. 每条语句包含的响应正文中的字段名称和值使用 eqne 运算符进行关联,并且语句可以使用 andor 进行组合。Each statement contains a field name from the response body and value that are associated with the eq or ne operators, and statements can be combined using and or or. filter 参数中的字符串值必须使用单引号引起来。String values must be surrounded by single quotes in the filter parameter. 例如, filter = dataType eq ' 采集 'For example, filter=dataType eq 'acquisition'.

此方法当前仅支持筛选器 运行状况Currently this method only supports the filter health.

No

请求示例Request example

下面的示例演示获取见解数据的请求。The following example demonstrates a request for getting insights data. applicationId 值替换为桌面应用程序的适当值。Replace the applicationId value with the appropriate value for your desktop application.

GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/desktop/insights?applicationId=10238467886765136388&startDate=6/1/2018&endDate=6/15/2018&filter=dataType eq 'health' HTTP/1.1
Authorization: Bearer <your access token>

响应Response

响应正文Response body

Value 类型Type 说明Description
Value arrayarray 包含应用的见解数据的对象数组。An array of objects that contain insights data for the app. 有关每个对象中的数据的详细信息,请参阅下面的 " 见解值 " 一节。For more information about the data in each object, see the Insight values section below.
TotalCountTotalCount intint 查询的数据结果中的行总数。The total number of rows in the data result for the query.

见解值Insight values

Value 数组中的元素包含以下值。Elements in the Value array contain the following values.

Value 类型Type 描述Description
applicationIdapplicationId 字符串string 为其检索 insights 数据的桌面应用程序的产品 ID。The product ID of the desktop application for which you retrieved insights data.
insightDateinsightDate 字符串string 标识特定度量值的更改的日期。The date on which we identified the change in a specific metric. 此日期表示一周结束时间,在该时间内我们检测到,与之前的一周相比,此指标的增减量明显增加或降低。This date represents the end of the week in which we detected a significant increase or decrease in a metric compared to the week before that.
dataTypedataType 字符串string 一个字符串,指定此见解通知的常规分析区域。A string that specifies the general analytics area that this insight informs. 目前,此方法仅支持 运行状况Currently, this method only supports health.
insightDetailinsightDetail arrayarray 表示当前见解的详细信息的一个或多个 InsightDetail 值One or more InsightDetail values that represent the details for current insight.

InsightDetail 值InsightDetail values

Value 类型Type 描述Description
FactNameFactName 字符串string 一个字符串,指示当前见解或当前维度描述的指标。A string that indicates the metric that the current insight or current dimension describes. 目前,此方法仅支持值 点击次数Currently, this method only supports the value HitCount.
SubDimensionsSubDimensions arrayarray 一个或多个对象,这些对象描述了见解的单个指标。One or more objects that describe a single metric for the insight.
PercentChangePercentChange 字符串string 整个客户群指标变化的百分比。The percentage that the metric changed across your entire customer base.
DimensionNameDimensionName 字符串string 当前维度中描述的度量值的名称。The name of the metric described in the current dimension. 示例包括 事件=、 市场DeviceTypePackageVersionExamples include EventType, Market, DeviceType, and PackageVersion.
DimensionValueDimensionValue 字符串string 当前维度中描述的度量值。The value of the metric that is described in the current dimension. 例如,如果DimensionNameDimensionValue ,则可能故障挂起For example, if DimensionName is EventType, DimensionValue might be crash or hang.
FactValueFactValue 字符串string 检测到见解时的日期的绝对值。The absolute value of the metric on the date the insight was detected.
方向Direction 字符串string 更改的方向 (正面) 。The direction of the change (Positive or Negative).
日期Date 字符串string 确定与当前见解或当前维度相关的更改的日期。The date on which we identified the change related to the current insight or the current dimension.

响应示例Response example

以下示例举例说明此请求的 JSON 响应正文。The following example demonstrates an example JSON response body for this request.

{
  "Value": [
    {
      "applicationId": "9NBLGGGZ5QDR",
      "insightDate": "2018-06-03T00:00:00",
      "dataType": "health",
      "insightDetail": [
        {
          "FactName": "HitCount",
          "SubDimensions": [
            {
              "FactName:": "HitCount",
              "PercentChange": "21",
              "DimensionValue:": "DE",
              "FactValue": "109",
              "Direction": "Positive",
              "Date": "6/3/2018 12:00:00 AM",
              "DimensionName": "Market"
            }
          ],
          "DimensionValue": "crash",
          "Date": "6/3/2018 12:00:00 AM",
          "DimensionName": "EventType"
        },
        {
          "FactName": "HitCount",
          "SubDimensions": [
            {
              "FactName:": "HitCount",
              "PercentChange": "71",
              "DimensionValue:": "JP",
              "FactValue": "112",
              "Direction": "Positive",
              "Date": "6/3/2018 12:00:00 AM",
              "DimensionName": "Market"
            }
          ],
          "DimensionValue": "hang",
          "Date": "6/3/2018 12:00:00 AM",
          "DimensionName": "EventType"
        },
      ],
      "insightId": "9CY0F3VBT1AS942AFQaeyO0k2zUKfyOhrOHc0036Iwc="
    }
  ],
  "@nextLink": null,
  "TotalCount": 2
}