| Method | getobj.report_table |
|---|---|
| Description | Retrieving table data in a user report |
| Available to | Agent, Client |
| Necessary components for working with the method | Data API for configuration |
| Method weight | 1 point |
Request parameters
| Name | Type | Required | Valid values | Description |
|---|---|---|---|---|
access_token |
string | yes | Authentication session key | |
user_id |
number | no | Unique user identifier of the agent client on behalf of which the request is made Is required for the agentTo obtain a list of client users, you must use the method "get.customer_users" |
|
limit |
number | yes | You cannot request more than 200 lines. |
Number of records to return. Default 50. |
offset |
number | yes | Shift - determines from which record number to return limit records. Default 0. |
|
report_type |
enum | yes | call_summary_uis summary_analytics | User report type. Currently only works for report type call_summary_uis и summary_analytics. To get a list of user reports, you must use the "get.reports_list" | method
date_from |
iso8601 | yes | YYYY-MM-DD hh:mm:ss | Start date of main sample (limit 366 days) |
date_till |
iso8601 | yes | YYYY-MM-DD hh:mm:ss | End date of the main sample |
dimensions |
array | yes | List of dimension mnemonics, separated by comma. For an available list of dimensions, see "Getting dimension nesting" . The order affects the construction of the tree. | |
columns |
array | yes | List of custom column identifiers, separated by comma. For a list of available columns, see "Getting Column Nesting" . The order affects the answer. | |
| Filters used in the report | filter |
object | no | It is permissible to use no more than 2 уровней nesting. See examples below |
Filters applied in the report. The construction logic is similar to "Filtering criteria" |
filters |
array | yes | An expression can contain both simple filters and a filter tree. | |
field |
string | The field of the entity to which filtering will be applied (the list is predefined for the method | ||
operator |
enum | Filtering operator. A list of all operators can be obtained in the section "Filtering operators" | ||
value |
string | Value for the filtering operator. Optional field; if it is missing, it is considered empty. | ||
| Filters applied to columns | columns_filter |
object | no | It is permissible to use no more than 2 уровней nesting. See examples below |
Filters applied to columns. The construction logic is similar to "Filtering criteria" |
filters |
array | yes | An expression can contain both simple filters and a filter tree. | |
field |
string | The field of the entity to which filtering will be applied (the list is predefined for the method | ||
operator |
enum | Filtering operator. A list of all operators can be obtained in the section "Filtering operators" | ||
value |
string | Value for the filtering operator. Optional field; if it is missing, it is considered empty. | ||
| Sorting used in the report | ||||
sort |
array | no | The sorting used in the report. The logic of construction is similar to "Sorting data" | |
| Row expansion | ||||
parent_dimensions_value_ids |
array | no | ["N","M"] | Select a report line for further expansion. Consists of a sequential list of dimension row identifiers. If not specified, level 1 is returned. |
Response parameters
| Name | Type | Valid values | Filtering | Sorting | Default response | Description |
|---|---|---|---|---|---|---|
date_from |
iso8601 | YYYY-MM-DD hh:mm:ss | yes | yes | Start date of the main sample | |
date_till |
iso8601 | YYYY-MM-DD hh:mm:ss | yes | yes | End date of the main sample | |
| Array of strings of the requested report | ||||||
rows |
array | yes | Массив строк запрашиваемого отчета |
|||
| List of requested dimensions | ||||||
dimension |
array | yes | List of values requested by dimensions |
|||
value |
string | yes | yes | If there is no data in the requested dimension, Не определено | is returned
Name of values requested dimensions |
|
value_id |
string | Unique identifier of the value branch of the requested dimensions | ||||
| List of requested columns | ||||||
columns |
array | yes | yes | List of values of the requested columns in the dimension context | ||
expandable |
boolean | Is it possible to expand a dimension | ||||
JSON request structure```json
{ "id": "number", "jsonrpc": "2.0", "method": "getobj.report_table", "params": { "access_token": "string", "user_id": "number", "limit": "number", "offset": "number", "report_type": "enum", "date_from": "iso8601", "date_till": "iso8601", "dimensions": [ "dimension1", "dimensionN" ], "columns": [ "column1", "columnN" ], "parent_dimensions_value_ids": [ "N", "M" ], "filter":{
},
"columns_filter":{
},
"sort": [
{
"field": "string",
"order": "string"
}
]
}
}
### JSON example request structure```json
{
"id": "number",
"jsonrpc": "2.0",
"method": "getobj.report_table",
"params": {
"access_token": "string",
"user_id": "number",
"limit": "number",
"offset": "number",
"report_type": "call_summary_uis",
"date_from": "2020-02-01 00:00:00",
"date_till": "2020-02-01 23:59:59",
"dimensions": [
"site",
"gr"
],
"columns": [
"cc_5"
],
"filter":{
"filters":[
{
"filters":[
{
"field":"tags",
"operator":"=",
"value":"Целевой"
},
{
"field":"tags",
"operator":"=",
"value":"Лид"
}
],
"condition":"or"
},
{
"filters":[
{
"field":"site_domain",
"operator":"=",
"value":"www.site1.ru"
},
{
"field":"site_domain",
"operator":"=",
"value":"www.site1.ru"
}
],
"condition":"or"
}
],
"condition":"and"
},
"columns_filter":{
"field":"cc_5",
"value":1,
"operator":">"
}
}
}
JSON response structure```JSON
{ "jsonrpc": "2.0", "id": "number", "result": { "data": { "date_from": "iso8601", "date_till": "iso8601", "rows": [ { "dimension": { "value": "string", "value_id": "string" }, "columns": [ "float" ], "expandable": "boolean" } ]
}
}
}
### JSON Example response```JSON
{
"id": "1",
"jsonrpc": "2.0",
"result": {
"data": {
"date_from": "2020-02-19 00:00:00",
"date_till": "2020-02-20 23:59:59",
"rows": [
{
"columns": [
16.0,
25.0,
43.75
],
"dimension": {
"value": "Google Chrome",
"value_id": "6"
},
"expandable": false
},
{
"columns": [
11.0,
11.0,
36.36363636
],
"dimension": {
"value": "Яндекс.Браузер",
"value_id": "70"
},
"expandable": true
}
]
}
}
}
JSON Examples of filter nesting
Minimum nesting level```JSON
{ "filter":{ "field":"tags", "operator":"=", "value":"Целевой" } }
#### Maximum nesting level (Nesting level = 2)```JSON
{
"filter":{
"filters":[
{
"filters":[
{
"field":"string",
"operator":"enum",
"value":"string"
}
],
"condition":"or"
},
{
"filters":[
{
"field":"string",
"operator":"enum",
"value":"string"
}
],
"condition":"or"
}
],
"condition":"and"
}
}
List of returned errors
Look at the section "List of errors for methods with the verb getobj"