get_report_tables

To get the list of tables that can be included in reports, use the report/get_report_tables method.

Endpoint

Copied!
svc=report/get_report_tables&params={}

Parameters

The request doesn’t require any parameters.

Returned result

If the request is completed successfully, a response in the following format is returned:

Copied!
[
	{
		"id":<uint>,		/* table ID */
		"n":"<text>",			/* system table name */
		"l":"<text>",			/* default table name */
		"t":"<text>",			/* table type */
		"ct":"<text>",		/* type of the template in which this table can be used */
		"pt":"<text>",		/* text parameters */
		"gt":"<text>",		/* advanced grouping settings */
		"col":[				/* the array of columns */
			{
				"n":"<text>",		/* system column name */
				"l":"<text>",		/* default column name */
				"sl":"<text>",	/* the list of column headers (if it is a statistics table) */
				"t":"<text>",		/* column type */
				"f":<uint>		/* column flags (see below) */
				"calc_type":<uint>		/* grouping value (if set) */
				"available_calc_types":<uint>		/* grouping values available for the column (if applicable) */
			}
		]
	}
]

The types of report templates are described in the Template types section. Table flags are described on the exec_report page.

Table names and types

Each table is registered separately for every template type, so its n value is unique. The same table has a different name in each template type. For example, the Trips table is unit_trips in an avl_unit template and unit_group_trips in an avl_unit_group template. Use the n value to specify tables in the report/update_report request.

Tables with the same t value are calculated in the same way. To find the counterpart of a table in another template type, look for a table with the same t value and the required ct value.

Not all tables are available for every template type. For example, the Chart (Regular), Fuel traffic, Images, Messages tracing, and Video tables are available for avl_unit templates but have no counterpart for avl_unit_group.

The contents of the unit_location table (Unit latest data) depend on the template type. The table exists for both avl_unit and avl_unit_group, but in an avl_unit template all of its columns are statistics columns with the 0x02 flag. In this case, the table has no rows and adds a block to the report statistics only. As a regular table, Unit latest data is available for avl_unit_group templates only.

The returned list also depends on the account. Tables are filtered by the services available to the current user, so different users can receive different lists of tables.

Column flags

The f parameter of a column can have the following values:

HEX flag DEC flag Description
0x01 1 Show as table column.
0x02 2 Show as statistics column.
0x04 4 Show as global switcher.
0x08 8 Show as column with position data.
0x10 16 Show as chart axis.
0x20 32 Hide the column in the report table. Used together with 0x10 for the sensor columns of charts.
0x40 64 Show as a custom chart.
0x100 256 Show as a marker on the chart.
0x200 512 Show as a background region on the chart.

The f value is a bitmask, so a column can have several flags at once. For example, 0x01 + 0x02 = 0x03 means that the column is shown both as a table column and as a statistics column.

The columns with the 0x100 and 0x200 flags belong to the tables that supply data for the chart (for example, unit_events or unit_stays), not to the chart table itself. They define what is drawn on the chart. For details, see Markers and Background.

Values of the “pt” parameter

The pt parameter lists the text parameters and options available for the table. It can have the following values:

Value Description
geozones Geofences/Units.
unfinished_ival Unfinished interval.
duration Duration.
mileage Mileage.
base_eh_sensor Engine hours sensor.
engine_hours Engine hours.
speed Speed.
trips Trips.
stops Stops.
parkings Parkings.
sensors Sensors.
sensor_name Sensor mask.
driver Driver.
trailer Trailer.
fillings Fillings.
thefts Fuel drains.
duration_format Duration format.
geozones_ex Extended geofences/units.
username Username mask.
route_points Route points.
event_mask Event mask.
rides Rides, applicable for the Unit and Rides tables.
fields_config Field type, applicable for the Custom fields tables.
units Units, applicable for the Manoeuvres table.
interval Tracing interval in minutes, applicable for the UnitSensor tracing table.
group_zones_pass The Consider group as a whole option is available. Applicable for the Unit groupNon-visited geofences table.
routes Applicable for the Route type tables.
last_location The Consider report interval option is available. Applicable for the Unit latest data table.
hide_total The Total checkbox is hidden for that table.
groupitem The Group itself option is available. Applicable for the Unit groupLog and Custom fields tables.
noschedule No Time limitation option available. Applicable for the Summary and Latest unit data tables.
hide_driver_split The Retrieve intervals checkbox is hidden in the driver filter.
account_tree Account tree.
custom_fields_mask Custom fields mask.
drv_activity Driver activity.
movement_chronology Movement chronology.
sensor_val Sensor value.
timeout_sensor Sensor timeout.
custom_sensor_name Custom sensor name.
filter_notifications Keep only messages with a notification text.

Error codes

Error code Description
6 Undefined error.

If you find a mistake in the text, please select it and press Ctrl+Enter.