get_report_data
To get the data of a report template, use the report/get_report_data method.
Endpoint
svc=report/get_report_data¶ms={
"itemId": <long>,
"col": [<long>],
"flags": <uint>
}
Parameters
The request must contain the following parameters:
| Name | Description |
|---|---|
| itemId | Resource ID. |
| col | The array of template IDs. |
| flags | Response flags. |
Response flags
The flags parameter defines the amount of data returned in the response:
| HEX flag | DEC flag | Description |
|---|---|---|
| 0x0 | 0 | Full JSON (default). |
| 0x1 | 1 | Basic information and assigned units/groups. |
| 0x2 | 2 | Basic information and short tables information. |
| 0x4 | 4 | Basic information and full tables information. |
Returned result
If the request is completed successfully, a response in the following format is returned:
[
{
"id":<long>, /* template ID */
"n":"<text>", /* name */
"ct":"<text>", /* type (see below) */
"c":"<text>", /* data CRC16 */
"p":"<text>", /* parameters */
"tbl":[ /* tables */
{
"n":"<text>", /* system table name */
"l":"<text>", /* table name displayed in the report */
"c":"<text>", /* the list of columns */
"cl":"<text>", /* the list of column labels */
"cp":"<text>", /* the list of columns parameters */
"s":"<text>", /* the list of columns (if it is a statistics table) */
"sl":"<text>", /* the list of column labels (if it is a statistics table) */
"filter_order":"<text>", /* filters order */
"p":"<text>", /* table parameters */
"sch":{ /* time limitation */
"f1":<uint>, /* the beginning of interval 1 */
"f2":<uint>, /* the beginning of interval 2 */
"t1":<uint>, /* the end of interval 1 */
"t2":<uint>, /* the end of interval 2 */
"m":<uint>, /* days of month mask */
"y":<uint>, /* months mask */
"w":<uint> /* days of week mask */
"fl":<uint> /* incomplete interval (0 - don't cut off, 1 - show and cut off, 2 - don't show in the report, 3 - show and mark as incomplete) */
},
"f":<uint> /* table flags */
}
]
}
]
Table flags are described on the exec_report page. To get the types of tables which can be included in reports, use the get_report_tables method.
Otherwise, an error code is returned.
Template types
The ct parameter can have the following values:
- avl_unit
- avl_unit_group
- storage_user
- avl_driver
- avl_trailer
- avl_resource
- avl_retranslator
- avl_route
- avl_drivers_group
- avl_trailers_group
- avl_tag
- avl_tags_group
- avl_geozone
- avl_geozones_group
Error codes
| Error code | Description |
|---|---|
| 7 | Failed to fetch the report object and the report resource. The user may not have the View report templates access right to the resource. |
| 4 | Wrong input parameters. |