Creating a log request

Creates a log request.

Note

The Logs API doesn't support filtering at the request level.

Request

POST

https://api-metrica.yandex.net/management/v1/counter/{counterId}/logrequests

Path parameters

Name

Description

counterId*

Type: integer<int32>

Tag ID.
Example: 2215573

Query parameters

Name

Description

date1*

Type: string

First day.
Example: 2016-01-01T00:00:00.000Z

date2*

Type: string

Last day (can't be the current day).
Example: 2016-01-31T00:00:00.000Z

fields*

Type: string

List of fields separated by commas.
Example: ym:pv:dateTime,ym:pv:referer

source*

Type: string[]

Log source.
Log source. Possible values:

  • hits: Events.
  • visits: Sessions.
    Example: hits

attribution

Type: string

Attribution model. Possible values:

  • FIRST: First click.
  • LAST: Last click.
  • LASTSIGN: Last non-direct click.
  • LAST_YANDEX_DIRECT_CLICK: Last click from Yandex Direct.
  • CROSS_DEVICE_LAST_SIGNIFICANT: Last non-direct click (cross-device), including sessions from all the user's devices.
  • CROSS_DEVICE_FIRST: First non-direct click (cross-device), including sessions from all the user's devices.
  • CROSS_DEVICE_LAST_YANDEX_DIRECT_CLICK: Last click from Yandex Direct (cross-device), including sessions from all the user's devices.
  • CROSS_DEVICE_LAST: Last click (cross-device), including sessions from all the user's devices.
  • AUTOMATIC: Automatic attribution.
    Example: FIRST

Responses

200 OK

OK

Body

application/json
{
    "log_request": {
        "request_id": 0,
        "counter_id": 0,
        "source": [
            "string"
        ],
        "date1": "string",
        "date2": "string",
        "fields": [
            "string"
        ],
        "status": "string",
        "size": 0,
        "parts": [
            {
                "part_number": 0,
                "size": 0
            }
        ],
        "attribution": "string"
    }
}

Name

Description

log_request

Type: LogRequest

Log request.

LogRequest

Log request.

Name

Description

attribution

Type: string

Attribution model. Possible values:

  • FIRST: First click.
  • LAST: Last click.
  • LASTSIGN: Last non-direct click.
  • LAST_YANDEX_DIRECT_CLICK: Last click from Yandex Direct.
  • CROSS_DEVICE_LAST_SIGNIFICANT: Last non-direct click (cross-device), including sessions from all the user's devices.
  • CROSS_DEVICE_FIRST: First non-direct click (cross-device), including sessions from all the user's devices.
  • CROSS_DEVICE_LAST_YANDEX_DIRECT_CLICK: Last click from Yandex Direct (cross-device), including sessions from all the user's devices.
  • CROSS_DEVICE_LAST: Last click (cross-device), including sessions from all the user's devices.
  • AUTOMATIC: Automatic attribution.

counter_id

Type: integer<int32>

Tag ID.

date1

Type: string

First day.

date2

Type: string

Last day.

fields

Type: string[]

List of fields.

parts

Type: LogRequestPart[]

Response parts.

request_id

Type: integer<int32>

Log request ID.

size

Type: integer

Size of logs in the request in bytes.

source

Type: string[]

Log source. Possible values:

  • hits: Events.
  • visits: Sessions.

Note

The ym:s:&lt;attribution&gt;RecommendationSystem and ym:s:&lt;attribution&gt;Messenger session parameters may return arrays with some data omitted:

  • There will be [] in the response if all pageview sources are unknown.
  • If an array contains multiple sources, some of which are known, while others are not, they will be comma-separated in the response.
  • An unknown source will be returned as an empty string. For example, [,,,telegram].

status

Type: string

Request status:

  • created: Created.
  • canceled: Canceled.
  • processed: Processed.
  • cleaned_by_user: Cleared by user.
  • cleaned_automatically_as_too_old: Cleared automatically.
  • processing_failed: Processing error.
  • awaiting_retry: To be restarted.

LogRequestPart

Response parts.

Name

Description

part_number

Type: integer<int32>

Part number.

size

Type: integer<int64>

Size in bytes.