Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Комментарий: Published by Scroll Versions from space TMAG and version 7.2
Sv translation
languageru

Описание: Недокументированный метод получения статистики по событиям, отдаёт только статистику по дате перехвата.

Метод:  GET

Ресурс: event/stat

Параметры:

  • fields  — список полей, которые нужно выбрать: CAPTURE_DATE , INSERT_DATE , totalCount (с версии API 1.2)
  • filter — список фильтрации:
    • date[from] — дата начала в формате UNIX-timestamp (можно использовать отдельно от date[to])
    • date[to] — дата окончания в формате UNIX-timestamp (можно использовать отдельно от date[from])
    • insert_date[>] — дата вставки начала в формате UNIX-timestamp и через точку microtime, например filter[insert_date][>]=1234.123312 (с версии API 1.1)
    • insert_date[<] — дата вставки окончания в формате UNIX-timestamp и через точку microtime, например filter[insert_date][<]=1234.123312 (с версии API 1.1)
    • insert_date[>=] — дата вставки начала в формате UNIX-timestamp и через точку microtime, например filter[insert_date][>=]=1234.123312(включительно) (с версии API 1.1)
    • insert_date[<=] — дата вставки окончания в формате UNIX-timestamp и через точку microtime, например filter[insert_date][<=]=1234.123312(включительно) (с версии API 1.1)
    • object_type_code[] — тип события (возможно несколько значений) (с версии API 1.1)
    • violation_level[] — уровень нарушения (с версии API 1.1)

Ответ: Статистика по событиям, описанная следующей JSON-Schema:

JSON схема отдачи:

 

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "data": {
            "description": "Пустая секция",
            "items": {},
            "type": "array"
        },
        "meta": {
            "description": "Дополнительные данные",
            "type": "object",
            "properties": {
                "CAPTURE_DATE": {
                    "description": "Статистика по полю CAPTURE_DATE",
                    "type": "object",
                    "properties": {
                        "from": {
                            "type": "string",
                            "description": "Дата перехвата первого события в выборке"
                        },
                        "to": {
                            "type": "string",
                            "description": "Дата перехвата последнего события в выборке"
                        }
                    }
                },
                "INSERT_DATE": {
                    "description": "Статистика по полю INSERT_DATE (с версии API 1.1)",
                    "type": "object",
                    "properties": {
                        "from": {
                            "type": "string",
                            "description": "Дата вставки первого события в выборке"
                        },
                        "to": {
                            "type": "string",
                            "description": "Дата вставки последнего события в выборке"
                        }
                    }
                },
                "totalCount": {
                    "type": "integer",
                    "description": "Общее количество событий"
                }
            }
        }
    }
}

 

Пример:

Запрос

 

GET /xapi/event/stat?filter[data][from]=0
X-API-Version: 1.3
X-API-CompanyId: iw
X-API-ImporterName: dome
X-API-Auth-Token: brse99dugp1cdbr69axz

 

Ответ

 

{
    "data": [],
    "meta": {
        "CAPTURE_DATE": {
            "from": "2017-04-16 00:00:04",
            "to": "2017-05-16 16:20:36"
        },
        "INSERT_DATE": {
            "from": "2017-04-16 00:01:07",
            "to": "2017-05-16 16:20:40"
        },
        "totalCount": 225075
    }
}
Sv translation
languageen

Description: An undocumented method of getting statistics on events, for now, it only provides statistics by the interception date.

Method:  GET

Resource: event/stat

Parameters:

  • fields — a list of fields to be selected: CAPTURE_DATE , INSERT_DATE , totalCount (API 1.2 version)
  • filter — a filtering list:
    • date[from] — start date in the UNIX-timestamp format (can be used separately from date[to])
    • date[to] — end date in the UNIX-timestamp format (can be used separately from date[from])
    • insert_date[>] — date of start pasting in the UNIX-timestamp format and via microtime point, for example filter[insert_date][>]=1234.123312 (starting from API 1.1 version)
    • insert_date[<] —  date of end pasting in the UNIX-timestamp format and via microtime point, for example filter[insert_date][>]=1234.123312 (starting from API 1.1 version)
    • insert_date[>=] — date of start pasting in the UNIX-timestamp format and via microtime point, for example filter[insert_date][>]=1234.123312(including) (starting from API 1.1 version)
    • insert_date[<=] — date of end pasting in the UNIX-timestamp format and via microtime point, for example filter[insert_date][>]=1234.123312(including) (starting from API 1.1 version)
    • object_type_code[] — type of event (could be few values) (starting from API 1.1 version)
    • violation_level[] — level of violation (starting from API 1.1 version)

Ответ: Statistics on events described with the following JSON Schema:

JSON return schema:


{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "data": {
            "description": "Empty section",
            "items": {},
            "type": "array"
        },
        "meta": {
            "description": "Additional data",
            "type": "object",
            "properties": {
                "CAPTURE_DATE": {
                    "description": "Statistics by field CAPTURE_DATE",
                    "type": "object",
                    "properties": {
                        "from": {
                            "type": "string",
                            "description": "The date of capture of the first event in selection"
                        },
                        "to": {
                            "type": "string",
                            "description": "The date of capture of the last event in selection"
                        }
                    }
                },
                "INSERT_DATE": {
                    "description": "Statistics by field INSERT_DATE (API 1.1 version)",
                    "type": "object",
                    "properties": {
                        "from": {
                            "type": "string",
                            "description": "The date of insertion of the first event in selection"
                        },
                        "to": {
                            "type": "string",
                            "description": "The date of insertion of the last event in selection"
                        }
                    }
                },
                "totalCount": {
                    "type": "integer",
                    "description": "Total number of events"
                }
            }
        }
    }
}


Example:

Query


GET /xapi/event/stat?filter[data][from]= 0
X-API-Version:  1.3
X-API-CompanyId: iw
X-API-ImporterName: dome
X-API-Auth-Token: brse99dugp1cdbr69axz


Response


{
    "data": [],
    "meta": {
        "CAPTURE_DATE": {
            "from": "2017-04-16 00:00:04",
            "to": "2017-05-16 16:20:36"
        },
        "INSERT_DATE": {
            "from": "2017-04-16 00:01:07",
            "to": "2017-05-16 16:20:40"
        },
        "totalCount": 225075
    }
}