get_statistics

The get_statistics function is used to receive the aggregated statistics information.

Copied!
svc=core/get_statistics&params={"resourceId":<long>, 
								"timeFrom":<uint>,
								"timeTo":<uint>,
								"type":"<text>",
								"interval_type":<uint>,
								"recursive":<uint>}

Parameters

Name Description
resourceId Resource ID.
timeFrom Time from in the Unix time format.
timeTo Time to in the Unix time format
type One of following: items, logins, hw, sms.
interval_type The style of grouping the results:
  • 1 — by days;
  • 2 — by weeks;
  • 4 — by months;
  • 8 — by quarters.
The default value is 1.
recursive Depending on the value:
  • 0 — use messages only from desired resource;
  • 1 — use messages also from child resources.

Returned result

Copied!
{
	"<timestamp>":{ 
		"<resource_id>":{
			"<parameter_name>": <int>,	/* statistics parameter Name-Value pairs  */
			...
		}
	},
	...,
	"users": {
		"<user_id>": "<text>",	/* ID — name pairs */
		...
		
	}
}

The list of available statistics parameters:

  • sms_count;
  • sms_nf_count;
  • sms_count_<user_id>;
  • sms_job_count;
  • sms_order_count;
  • sms_manual_count;
  • sms_auth_count;
  • sms_cmd_<sms_type>_count;
  • logins_count_<user_id>;
  • logins_duration_<user_id>;
  • <unit_type_name>_deleted;
  • <unit_type_name>_created;
  • <item_type_name>_created;
  • <resource_type_name>_created;
  • <type_name>_created;
  • hw_<hw_type_id>;
  • <user_type_name>_created;
  • avl_driver_created;
  • avl_driver_deleted;
  • avl_job_created;
  • avl_job_deleted;
  • avl_notification_created;
  • avl_notification_deleted;
  • avl_tag_created;
  • avl_tag_deleted;
  • avl_trailer_created;
  • avl_trailer_deleted;
  • avl_geozone_created;
  • avl_geozone_deleted;
  • avl_unit_sensor_created;
  • avl_unit_sensor_deleted;
  • avl_unit_activated;
  • avl_unit_deactivated;
  • avl_unit_total.

The parameter avl_unit_total is returned in response to the request with “type”: “items”. It shows the total number of units related to the specified account and subordinate accounts.

Error codes

Possible error codes:

Code Description
7 Failed to fetch the user with the desired ACL (ADF_ACL_ITEM_VIEW) or unexpected type value.
4 Wrong input parameters.

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