---
title: "Gets reports"
method: GET
path: "/reports/v4/{reportId}"
tags: ["Reports"]
---

# Gets reports

`GET /reports/v4/{reportId}`

Gets the report creation status and makes queries to fetch the actual reports.
Each report request can have a different set of query parameters.

> Note that in the report context an asset is a device.

Examples
---
To get a report on assets dwelling times in the specified geofence during the report period, 
create a request specifying the following:
* `reportId`: ID of a report created for a dwelling rule
* `measure`: 'duration'
* `groupBy`: 'asset'
* `geofenceId`: geofence ID

To get a report on how many times assets were in detention on average during each week of 
the report period, create a request specifying the following:
* `reportId`: ID of a report created for a detention rule
* `measure`: 'occurrence'
* `method`: 'average'
* `groupBy`: 'asset'
* `interval`: 'week'

## Query parameters

- `pageToken` string
- `limit` integer
- `measure` 'duration' | 'occurrence' | 'day' | 'asset'
- `interval` 'day' | 'week' | 'month'
- `trackingId` string — This is a unique ID associated with the device data in HERE Tracking. For physical devices the `trackingId` gets assigned to a device when the device is claimed by a user, and for virtual devices it is an external device ID along with the device project `appId`.
- `geofenceId` string, uuid — Geofence ID
- `groupBy` 'asset' | 'geofence'
- `method` 'average' | 'cumulative' | 'percentage'
- `sort` string

## Response `200`

Response body.

- object
  - `count` integer, required — Number of items returned in the response
  - `items` union[], required
    - union
      - object
        - `timestamp` string, date-time, required — Timestamp of the beginning of the interval
        - `value` number, required — The value of the report metric, which was specified in the `measure` parameter. * `measure`: `duration` => `value`: duration of the event in seconds over the time frame * `measure`: `occurrence` => `value`: number of event occurrences during the time frame * `measure`: `day` => `value`: the number of days the event lasted over the time frame * `measure`: `asset` => `value`: the number of assets that generated the event over the time frame When `value` is provided along with `timestamp`, the time frame is the specified interval. When `value` is provided with `trackingId` or `geofenceId`, the time frame is the whole report period. Additionally, if `method` parameter was given, the `value` represents average/cumulative/percentage of the calculated metric.
      - object
        - `trackingId` string, required — Tracking ID on which the `value` is calculated
        - `value` number, required — The value of the report metric, which was specified in the `measure` parameter. * `measure`: `duration` => `value`: duration of the event in seconds over the time frame * `measure`: `occurrence` => `value`: number of event occurrences during the time frame * `measure`: `day` => `value`: the number of days the event lasted over the time frame * `measure`: `asset` => `value`: the number of assets that generated the event over the time frame When `value` is provided along with `timestamp`, the time frame is the specified interval. When `value` is provided with `trackingId` or `geofenceId`, the time frame is the whole report period. Additionally, if `method` parameter was given, the `value` represents average/cumulative/percentage of the calculated metric.
      - object
        - `geofenceId` string, uuid, required — Geofence ID on which the `value` is calculated
        - `value` number, required — The value of the report metric, which was specified in the `measure` parameter. * `measure`: `duration` => `value`: duration of the event in seconds over the time frame * `measure`: `occurrence` => `value`: number of event occurrences during the time frame * `measure`: `day` => `value`: the number of days the event lasted over the time frame * `measure`: `asset` => `value`: the number of assets that generated the event over the time frame When `value` is provided along with `timestamp`, the time frame is the specified interval. When `value` is provided with `trackingId` or `geofenceId`, the time frame is the whole report period. Additionally, if `method` parameter was given, the `value` represents average/cumulative/percentage of the calculated metric.
      - object
        - `timestamp` string, date-time, required — Timestamp of the beginning of the event
        - `trackingId` string, required — This is a unique ID associated with the device data in HERE Tracking. For physical devices the `trackingId` gets assigned to a device when the device is claimed by a user, and for virtual devices it is an external device ID along with the device project `appId`.
        - `value` number, required — Duration of the event in seconds
  - `limit` integer, required — Maximum number of items as specified in request
  - `nextPageToken` string — Token to fetch the next page (if exists)
  - `status` 'pending' | 'started' | 'completed' | 'failed', required — Status of the report creation. When the status is `pending` or `started`, re-check the status later again. The actual reports can be queried only when the report creation status is 'completed'.

## Other responses

- `400` — Bad request The request object is in an incorrect format or has values that are invalid or out of range. If available, further error details are provided in the response body.
- `401` — Unauthorized The request did not provide correct authentication details
- `403` — Forbidden The account does not have the correct privileges
- `404` — Not Found The specified resource was not found

---

[API](https://skmtc.net/here/apis/tracking.md) · [All operations](https://skmtc.net/here/apis/tracking/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/here/tracking/revisions/efa162f7023c/schema)
