崩溃

返回特定日期范围内的崩溃数据。

请求格式

GET https://api.appmetrica.yandex.com/logs/v1/export/crashes.{csv | json}
  ? application_id=<int>
  & date_since=<string>
  & date_until=<string>
  & fields=<string>
  & [date_dimension=<string>]
  & [limit=<string>]
  & [use_utf8_bom=<bool>]
  & [<any field name>=<string>]
  & [skip_unavailable_shards=<bool>]

应用ID*

按应用在 AppMetrica 中的数字 ID 过滤。

date_since*

日期范围的开始,格式为 yyyy-mm-dd hh:mm:ss。 您还可以定义影响 date_dimension 查询参数中数据的日期和时间类型。

date_until*

日期范围的结束,格式为 yyyy-mm-dd hh:mm:ss。 您还可以定义影响 date_dimension 查询参数中数据的日期和时间类型。

fields*

用逗号分隔的字段列表用于示例。

一个包含所有可用字段的列表(便于快速复制):

crash,crash_datetime,crash_group_id,crash_id,crash_json,crash_name,crash_receive_datetime,crash_receive_timestamp,crash_timestamp,appmetrica_device_id,city,connection_type,country_iso_code,device_ipv6,device_locale,device_manufacturer,device_model,device_type,google_aid,ios_ifa,ios_ifv,mcc,mnc,operator_name,os_name,os_version,profile_id,windows_aid,app_package_name,app_version_name,application_id

date_dimension

此参数定义计算日期范围的起点:

  • default:事件在设备上发生时。
  • receive:服务器收到事件信息时。

限制

列表中项目数量的限制。 默认取最大值。 不保证请求之间的结果一致(结果排序可能存在差异)。

use_utf8_bom

启用字节顺序标记使用的参数。 默认值为 false。

<any field name>

按可用字段之一的值过滤。 仅支持相等检查操作。

skip_unavailable_shards

用于提高数据可用性。 默认值为 false。

响应格式

如果请求了所有可用的字段:

{
  "data": [
    {
      "crash": "string",
      "crash_datetime": "string",
      "crash_group_id": "integer",
      "crash_id": "integer",
      "crash_json": "string",        
      "crash_name": "string",
      "crash_receive_datetime": "string",
      "crash_receive_timestamp": "integer",
      "crash_timestamp": "integer",
      "appmetrica_device_id": "integer",
      "city": "string",
      "connection_type": "string",
      "country_iso_code": "string",
      "device_ipv6": "string",
      "device_locale": "string",
      "device_manufacturer": "string",
      "device_model": "string",
      "device_type": "string",
      "google_aid": "string",
      "ios_ifa": "string",
      "ios_ifv": "string",
      "mcc": "integer",
      "mnc": "integer",
      "operator_name": "string",
      "os_name": "string",
      "os_version": "string",
      "profile_id": "string",
      "windows_aid": "string",
      "app_package_name": "string",
      "app_version_name": "string",
      "application_id": "integer"
    },
    ...
  ]
}
application_id,ios_ifa,os_name,...
1111,024AE7EB-4128-4237-9803-D24950323D4D,ios,...
1111,3A86D5E8-1985-4A23-B147-5A1C0CF8781E,ios,...
1111,,android
...

崩溃

堆栈跟踪。

crash_datetime

应用崩溃的日期和时间,格式为 yyyy-mm-dd hh:mm:ss。

crash_group_id

相似崩溃组的 ID。

crash_id

崩溃 ID。

crash_json

包含崩溃参数的 JSON。

crash_name

崩溃名称。

crash_receive_datetime

服务器端收到崩溃消息的日期和时间,格式为 yyyy-mm-dd hh:mm:ss。 由于网络延迟或用户设备在事件发生时未连接,可能与 crash_datetime 不同。

crash_receive_timestamp

服务器端收到崩溃消息的时间,格式为 Unix time。 由于网络延迟或用户设备在事件发生时未连接,可能与 crash_timestamp 不同。

crash_timestamp

应用崩溃的时间,格式为 Unix time。

appmetrica_device_id

AppMetrica 服务检测到的唯一设备标识符。 在 Android 中来自 AppSetId,在 iOS 中来自 IFV。

城市

城市名称(英文)。

连接类型

连接类型。 可能的值:wifi | cell | unknown。

country_iso_code

ISO 国家代码。

device_ipv6

事件时的 IP 地址,格式为 IPv6。 例如,2a02:6b8::40c:6676:baff:fea6:53d8, ::ffff:5.255.232.147。

device_locale

设备上的语言。

设备制造商

AppMetrica 服务检测到的设备制造商(例如,Apple 或 Samsung)。

设备型号

AppMetrica 服务检测到的设备型号(例如,Galaxy S6)。

device_type

AppMetrica 服务检测到的设备类型。 可能的值:phone | tablet | unknown。

google_aid

设备的 Google AID,格式为从设备接收的格式。

ios_ifa

设备的 IFA,格式为从设备接收的格式。

ios_ifv

应用的 IFV,格式为从设备接收的格式。

mcc

移动国家代码。

mnc

移动网络代码。

operator_name

移动运营商名称。

os_name

用户设备上的操作系统:ios | android | windows。

os_version

用户设备上的操作系统版本。

profile_id

用户个人资料 ID。

windows_aid

设备的 Windows AID,格式为从设备接收的格式。

app_package_name

Android 的包名,或 iOS 的 Bundle ID(例如,ru.yandex.metro)。

app_version_name

开发者指定的应用版本格式。

application_id

应用在 AppMetrica 中的唯一数字标识符。

Example

请求:

curl -X GET \
  'https://api.appmetrica.yandex.com/logs/v1/export/crashes.json?application_id=1111&date_since=2018-10-10&date_until=2018-10-11&fields=crash,crash_datetime,crash_group_id,crash_id,crash_json,crash_name,crash_receive_datetime,crash_receive_timestamp,crash_timestamp,appmetrica_device_id,city,connection_type,country_iso_code,device_ipv6,device_locale,device_manufacturer,device_model,device_type,google_aid,ios_ifa,ios_ifv,mcc,mnc,operator_name,os_name,os_version,profile_id,windows_aid,app_package_name,app_version_name,application_id' \
  -H 'Authorization: OAuth oauth_token'

响应:

{
  "data": [
    {
      "crash": "Incident Identifier: 2BC150BD-6FBE-403E-A6EA-8BCBBB88D1FE\nCrashReporter Key: 45f8b76444af32746930a175a32f6ec4a3d34a81\nHardware Model: iPhone10,3,\n ... \"sessions_since_launch\": 1\n}\n",
      "crash_datetime": "yyyy-mm-dd hh:mm:ss",
      "crash_group_id": "2198476647264792568",
      "crash_id": "4076630759621469783",
      "crash_json": "{...}",      
      "crash_name": "crash_name__example",
      "crash_receive_datetime": "yyyy-mm-dd hh:mm:ss",
      "crash_receive_timestamp": "1556258667",
      "crash_timestamp": "1556258660",
      "appmetrica_device_id": "123456789012345678",
      "city": "Moscow",
      "connection_type": "wifi",
      "country_iso_code": "RU",
      "device_ipv6": "::ffff:5.255.232.147",
      "device_locale": "ru_RU",
      "device_manufacturer": "Apple",
      "device_model": "iPhone X",
      "device_type": "phone",
      "google_aid": "google_aid__example",
      "ios_ifa": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "ios_ifv": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "mcc": "250",
      "mnc": "1",
      "operator_name": "MTS RUS",
      "os_name": "ios",
      "os_version": "12.2",
      "profile_id": "test",
      "windows_aid": "windows_aid__example",
      "app_package_name": "ru.yandex.metro",
      "app_version_name": "1.0",
      "application_id": "1111"
    }
  ]
}

如果您没有找到所需答案,可以通过反馈表单提交您的问题。 请尽可能详细地描述问题。 如果可能,请附上截图。

联系支持 为文档提出改进建议