GET events/v3/statuses/deviceCounts
Operation ID: —
Auth: unknown
Description
This API call counts the number of devices and shipments that are currently in the different event states per rule or per event source (that is per rule type). An event state of a device is the event type of the most recent device event. It indicates a state the device is currently in, in relation to a rule the device is associated with. For example, the event state can be either `INSIDE_GEOFENCE` or `OUTSIDE_GEOFENCE` in case the event source is `geofence`; or `BELOW_RANGE`, `IN_RANGE` or `ABOVE_RANGE` in case the event source is `battery` rule. A device can be in several different event states at the same time when it has more than one rule associated with it. For example, a device can be at the same time in `INSIDE_GEOFENCE` and `ABOVE_RANGE` event states. The same applies for shipments. The `groupBy` query parameter defines how the results are grouped. The default value for the `groupBy` parameter is `ruleId`. The response contains a list of objects, one per each rule, that are associated to at least one device or shipment of the project. Each object has the following properties: * `ruleId`: a rule ID * `eventSource`: the rule type * every distinct event state (applicable for the rule type) and the number of devices in this state * `total`: the total number of devices associated to the rule When the `groupBy` parameter value is `eventSource`, the response contains a list of objects, one per event source (that is per each rule type), that are associated to at least one device or shipment of the project. Each object has the following properties: * `eventSource`: a rule type * every distinct event state (applicable for the rule type) and the number of devices in this state. One device is counted only once per `eventType` state, but in case a single device is associated to multiple rules of the same type, it will be counted separately for each event state. * `total`: the total number of devices associated to the rule type. A single device is counted only once. For example, a device A is associated to 2 geofences and is inside one and outside the other. A device B is associated to 3 geofences and is outside all of them. With the request query parameter set as `groupBy`=`eventSource`, the response body will contain the following result item: ``` { "eventSource": "geofence", "INSIDE_GEOFENCE": 1, "OUTSIDE_GEOFENCE": 2, "total": 2 }. ``` If the request is supplied with `eventSource` query parameter, the response results will be limited to the specified rule types only. If the request is supplied with `ruleId` query parameter, the response results will be limited to the specified rule IDs only. If the request is supplied with `trackingId` query parameter, the response results will be limited to the specified devices only. Also `shipmentId` can be used as a `trackingId`. If the request is supplied with `geofenceId` query parameter, it will only affect dwelling event statuses filtering, limiting the results to the specified geofence only. Other event types are not affected by this setting. Note that for the event statuses of geofence type, the `ruleId` is the `geofenceId`. If the request is supplied with `shipments` query parameter, the response results will be limited either to shipments (`shipments`=`true`) or devices (`shipments`=`false`) only. Otherwise, if `shipments` query parameter is not specified, response results will include both devices and shipments. All the aforementioned query parameters can be combined together.
Parameters (11)
(string, header, optional)
ID used for correlating requests within HERE Tracking. Used for logging and error reporting. Must be a valid UUIDv4.
(string, query, optional)
Application identifier. Used together with an external ID to identify a virtual device.
Constraints: {'minLength': 8}
(integer, query, optional, default: 1000)
The number of items to return per page.
Constraints: {'minimum': 1, 'maximum': 1000}
(?, query, optional)
(?, query, optional)
(string, query, optional, default: ruleId)
Constraints: {'enum': ['ruleId', 'eventSource']}
(string, query, optional)
A token from the previously returned response to retrieve the specified page.
(string, query, optional)
Constraints: {'minLength': 1, 'maxLength': 50}
(?, query, optional)
(boolean, query, optional)
(?, query, optional)
No probe data for this endpoint yet.