Reports

Generation of reports

The Reports Model

Onemap8 can serve 6 predefined reports. Each report is represented by the following schema:

Summary Report Scheme

  • Name
    deviceId
    Type
    integer
    Description
  • Name
    deviceName
    Type
    string
    Description
  • Name
    maxSpeed
    Type
    number
    Description
    in knots
  • Name
    averageSpeed
    Type
    number
    Description
    in knots
  • Name
    distance
    Type
    number
    Description
    in meters
  • Name
    spentFuel
    Type
    number
    Description
    in liters
  • Name
    engineHours
    Type
    integer
    Description

Trips Report Scheme

  • Name
    deviceId
    Type
    integer
    Description
  • Name
    deviceName
    Type
    string
    Description
  • Name
    maxSpeed
    Type
    number
    Description
    in knots
  • Name
    averageSpeed
    Type
    number
    Description
    in knots
  • Name
    distance
    Type
    number
    Description
    in meters
  • Name
    spentFuel
    Type
    number
    Description
    in liters
  • Name
    duration
    Type
    integer
    Description
  • Name
    startTime
    Type
    string
    Description
    in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
  • Name
    startAddress
    Type
    string
    Description
  • Name
    startLat
    Type
    number
    Description
  • Name
    startLon
    Type
    number
    Description
  • Name
    endTime
    Type
    string
    Description
    in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
  • Name
    endAddress
    Type
    string
    Description
  • Name
    endLat
    Type
    number
    Description
  • Name
    endLon
    Type
    number
    Description
  • Name
    driverUniqueId
    Type
    integer
    Description
  • Name
    driverName
    Type
    string
    Description

Stops Report Scheme

  • Name
    deviceId
    Type
    integer
    Description
  • Name
    deviceName
    Type
    string
    Description
  • Name
    duration
    Type
    integer
    Description
  • Name
    startTime
    Type
    string
    Description
    in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
  • Name
    address
    Type
    string
    Description
  • Name
    lat
    Type
    number
    Description
  • Name
    lon
    Type
    number
    Description
  • Name
    endTime
    Type
    string
    Description
    in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
  • Name
    spentFuel
    Type
    number
    Description
    in liters
  • Name
    engineHours
    Type
    integer
    Description

Geofences Report Scheme

  • Name
    deviceId
    Type
    integer
    Description
  • Name
    deviceName
    Type
    string
    Description
  • Name
    geofenceId
    Type
    integer
    Description
  • Name
    startTime
    Type
    string
    Description
    in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
  • Name
    endTime
    Type
    string
    Description
    in IS0 8601 format. eg. `1963-11-22T18:30:00Z`

GET/reports/route

Retrieve a list of positions within the time period for the Devices or Groups

At least one deviceId or one groupId must be passed.

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Query parameters

  • Name
    deviceId
    Type
    array of integer
    Description
  • Name
    groupId
    Type
    array of integer
    Description
  • Name
    from
    Type
    string required
    Description
    in IS0 8601 format. eg. 1963-11-22T18:30:00Z
  • Name
    to
    Type
    string required
    Description
    in IS0 8601 format. eg. 1963-11-22T18:30:00Z

Responses

  • Name
    200
    Type
    success
    Description
  • Name
    application/json
    Type
    schema
    Description
    Array of Route report

Request

GET
/reports/route
curl --location 'https://gw.onemap8.com/api/reports/route?deviceId=%3Cinteger%3E&deviceId=%3Cinteger%3E&groupId=%3Cinteger%3E&groupId=%3Cinteger%3E&from=%3CdateTime%3E&to=%3CdateTime%3E' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

[
{
"id": 0,
"deviceId": 0,
"protocol": "string",
"deviceTime": "2019-08-24T14:15:22Z",
"fixTime": "2019-08-24T14:15:22Z",
"serverTime": "2019-08-24T14:15:22Z",
"outdated": true,
"valid": true,
"latitude": 0,
"longitude": 0,
"altitude": 0,
"speed": 0,
"course": 0,
"address": "string",
"accuracy": 0,
"network": { },
"geofenceIds": [],
"attributes": { }
},
{
  ...
}
]

GET/reports/events

Retrieve a list of events within the time period for the Devices or Groups

At least one deviceId or one groupId must be passed.

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Query parameters

  • Name
    deviceId
    Type
    array of integer
    Description
  • Name
    groupId
    Type
    array of integer
    Description
  • Name
    type
    Type
    array of strings
    Description
    Can be used to return events of all types
  • Name
    from
    Type
    string required
    Description
    in IS0 8601 format. eg. 1963-11-22T18:30:00Z
  • Name
    to
    Type
    string required
    Description
    in IS0 8601 format. eg. 1963-11-22T18:30:00Z

Responses

  • Name
    200
    Type
    success
    Description
  • Name
    application/json
    Type
    schema
    Description
    Array of Events report

Request

GET
/reports/events
curl --location 'https://gw.onemap8.com/api/reports/route?deviceId=%3Cinteger%3E&deviceId=%3Cinteger%3E&groupId=%3Cinteger%3E&groupId=%3Cinteger%3E&from=%3CdateTime%3E&to=%3CdateTime%3E' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

[
{
  "id": 0,
  "type": "string",
  "eventTime": "2019-08-24T14:15:22Z",
  "deviceId": 0,
  "positionId": 0,
  "geofenceId": 0,
  "maintenanceId": 0,
  "attributes": { }
},
{
  ...
}
]

GET/reports/geofences

Retrieve geofence enter/exit intervals within the time period for the Devices or Groups

At least one deviceId or one groupId must be passed.

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Query parameters

  • Name
    deviceId
    Type
    array of integer
    Description
  • Name
    groupId
    Type
    array of integer
    Description
  • Name
    geofenceId
    Type
    array of integer
    Description
  • Name
    from
    Type
    string required
    Description
    in IS0 8601 format. eg. 1963-11-22T18:30:00Z
  • Name
    to
    Type
    string required
    Description
    in IS0 8601 format. eg. 1963-11-22T18:30:00Z

Responses

  • Name
    200
    Type
    success
    Description
  • Name
    application/json
    Type
    schema
    Description
    Array of Geofences report

Request

GET
/reports/geofences
curl --location 'https://gw.onemap8.com/api/reports/geofences?deviceId=%3Cinteger%3E&deviceId=%3Cinteger%3E&groupId=%3Cinteger%3E&groupId=%3Cinteger%3E&geofenceId=%3Cinteger%3E&from=%3CdateTime%3E&to=%3CdateTime%3E' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

[
{
  "deviceId": 0,
  "deviceName": "string",
  "geofenceId": 0,
  "startTime": "2019-08-24T14:15:22Z",
  "endTime": "2019-08-24T14:15:22Z"
},
{
  ...
}
]

GET/reports/summary

Retrieve a list of summaries within the time period for the Devices or Groups

At least one deviceId or one groupId must be passed.

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Query parameters

  • Name
    deviceId
    Type
    array of integer
    Description
  • Name
    groupId
    Type
    array of integer
    Description
  • Name
    from
    Type
    string required
    Description
    in IS0 8601 format. eg. 1963-11-22T18:30:00Z
  • Name
    to
    Type
    string required
    Description
    in IS0 8601 format. eg. 1963-11-22T18:30:00Z

Responses

  • Name
    200
    Type
    success
    Description
  • Name
    application/json
    Type
    schema
    Description
    Array of Summary report

Request

GET
/reports/summary
curl --location 'https://gw.onemap8.com/api/reports/summary?deviceId=%3Cinteger%3E&deviceId=%3Cinteger%3E&groupId=%3Cinteger%3E&groupId=%3Cinteger%3E&from=%3CdateTime%3E&to=%3CdateTime%3E' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

[
{
  "deviceId": 0,
  "deviceName": "string",
  "maxSpeed": 0,
  "averageSpeed": 0,
  "distance": 0,
  "spentFuel": 0,
  "engineHours": 0
},
{
  ...
}
]

GET/reports/trips

Retrieve a list of trips within the time period for the Devices or Groups

At least one deviceId or one groupId must be passed.

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Query parameters

  • Name
    deviceId
    Type
    array of integer
    Description
  • Name
    groupId
    Type
    array of integer
    Description
  • Name
    from
    Type
    string required
    Description
    in IS0 8601 format. eg. 1963-11-22T18:30:00Z
  • Name
    to
    Type
    string required
    Description
    in IS0 8601 format. eg. 1963-11-22T18:30:00Z

Responses

  • Name
    200
    Type
    success
    Description
  • Name
    application/json
    Type
    schema
    Description
    Array of Trips report

Request

GET
/reports/trips
curl --location 'https://gw.onemap8.com/api/reports/trips?deviceId=%3Cinteger%3E&deviceId=%3Cinteger%3E&groupId=%3Cinteger%3E&groupId=%3Cinteger%3E&from=%3CdateTime%3E&to=%3CdateTime%3E' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

[
{
  "deviceId": 0,
  "deviceName": "string",
  "maxSpeed": 0,
  "averageSpeed": 0,
  "distance": 0,
  "spentFuel": 0,
  "duration": 0,
  "startTime": "2019-08-24T14:15:22Z",
  "startAddress": "string",
  "startLat": 0,
  "startLon": 0,
  "endTime": "2019-08-24T14:15:22Z",
  "endAddress": "string",
  "endLat": 0,
  "endLon": 0,
  "driverUniqueId": 0,
  "driverName": "string"
},
{
  ...
}
]

GET/reports/stops

Retrieve a list of stops within the time period for the Devices or Groups

At least one deviceId or one groupId must be passed.

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Query parameters

  • Name
    deviceId
    Type
    array of integer
    Description
  • Name
    groupId
    Type
    array of integer
    Description
  • Name
    from
    Type
    string required
    Description
    in IS0 8601 format. eg. 1963-11-22T18:30:00Z
  • Name
    to
    Type
    string required
    Description
    in IS0 8601 format. eg. 1963-11-22T18:30:00Z

Responses

  • Name
    200
    Type
    success
    Description
  • Name
    application/json
    Type
    schema
    Description
    Array of Stops report

Request

GET
/reports/stops
curl --location 'https://gw.onemap8.com/api/reports/stops?deviceId=%3Cinteger%3E&deviceId=%3Cinteger%3E&groupId=%3Cinteger%3E&groupId=%3Cinteger%3E&from=%3CdateTime%3E&to=%3CdateTime%3E' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

[
{
  "deviceId": 0,
  "deviceName": "string",
  "duration": 0,
  "startTime": "2019-08-24T14:15:22Z",
  "address": "string",
  "lat": 0,
  "lon": 0,
  "endTime": "2019-08-24T14:15:22Z",
  "spentFuel": 0,
  "engineHours": 0
},
{
  ...
}
]
GET/reports/combined

Fetch a combined route, Events and Positions report for the Devices or Groups

At least one deviceId or one groupId must be passed

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Query Parameters

  • Name
    deviceId
    Type
    array of integer
    Description
  • Name
    groupId
    Type
    array of integer
    Description
  • Name
    from
    Type
    string <date-time> required
    Description
    in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  • Name
    to
    Type
    string <date-time> required
    Description
    in ISO 8601 format. eg. `1963-11-22T18:30:00Z`

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

Request

GET
/reports/combined
curl --location 'https://gw.onemap8.com/api/reports/combined?deviceId=<array>&groupId=<array>&from=<date-time>&to=<date-time>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

[
{
  "deviceId": 0,
  "route": [
      [
          0
      ]
  ],
  "events": [
      {
          "id": 0,
          "type": "<string>",
          "eventTime": "<date-time>",
          "deviceId": 0,
          "positionId": 0,
          "geofenceId": 0,
          "maintenanceId": 0,
          "attributes": {}
      }
  ],
  "positions": [
      {
          "id": 0,
          "deviceId": 0,
          "protocol": "<string>",
          "deviceTime": "<date-time>",
          "fixTime": "<date-time>",
          "serverTime": "<date-time>",
          "valid": true,
          "latitude": 0,
          "longitude": 0,
          "altitude": 0,
          "speed": 0,
          "course": 0,
          "address": "<string>",
          "accuracy": 0,
          "network": {},
          "geofenceIds": [
              0
          ],
          "attributes": {}
      }
  ]
}
]

GET/reports/route/{type}

Download the route report as a spreadsheet or send it by email

Use type=xlsx to download the report, type=mail to deliver it by email asynchronously.

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Path parameters

  • Name
    type
    Type
    string required
    Description

Query Parameters

  • Name
    deviceId
    Type
    array of integer
    Description
  • Name
    groupId
    Type
    array of integer
    Description
  • Name
    from
    Type
    string <date-time> required
    Description
    in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  • Name
    to
    Type
    string <date-time> required
    Description
    in ISO 8601 format. eg. `1963-11-22T18:30:00Z`

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description
    Spreadsheet attachment
  • Name
    204
    Type
    success
    Description
    Report queued for email delivery
  • Name
    401
    Type
    error
    Description
    Unauthorized
  • Name
    404
    Type
    error
    Description
    Not found

Request

GET
/reports/route/{type}
curl --location 'https://gw.onemap8.com/api/reports/route/<string>?deviceId=<array>&groupId=<array>&from=<date-time>&to=<date-time>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

"<binary>"

GET/reports/events/{type}

Download the events report as a spreadsheet or send it by email

Use type=xlsx to download the report, type=mail to deliver it by email asynchronously.

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Path parameters

  • Name
    type
    Type
    string required
    Description

Query Parameters

  • Name
    deviceId
    Type
    array of integer
    Description
  • Name
    groupId
    Type
    array of integer
    Description
  • Name
    type
    Type
    array of string
    Description
    Event types to include; `%` matches all
  • Name
    alarm
    Type
    array of string
    Description
    Alarm types to include
  • Name
    from
    Type
    string <date-time> required
    Description
    in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  • Name
    to
    Type
    string <date-time> required
    Description
    in ISO 8601 format. eg. `1963-11-22T18:30:00Z`

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description
    Spreadsheet attachment
  • Name
    204
    Type
    success
    Description
    Report queued for email delivery
  • Name
    401
    Type
    error
    Description
    Unauthorized
  • Name
    404
    Type
    error
    Description
    Not found

Request

GET
/reports/events/{type}
curl --location 'https://gw.onemap8.com/api/reports/events/<string>?deviceId=<array>&groupId=<array>&type=<array>&alarm=<array>&from=<date-time>&to=<date-time>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

"<binary>"

GET/reports/summary/{type}

Download the summary report as a spreadsheet or send it by email

Use type=xlsx to download the report, type=mail to deliver it by email asynchronously.

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Path parameters

  • Name
    type
    Type
    string required
    Description

Query Parameters

  • Name
    deviceId
    Type
    array of integer
    Description
  • Name
    groupId
    Type
    array of integer
    Description
  • Name
    from
    Type
    string <date-time> required
    Description
    in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  • Name
    to
    Type
    string <date-time> required
    Description
    in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  • Name
    daily
    Type
    boolean
    Description
    Aggregate values by day instead of the full period

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description
    Spreadsheet attachment
  • Name
    204
    Type
    success
    Description
    Report queued for email delivery
  • Name
    401
    Type
    error
    Description
    Unauthorized
  • Name
    404
    Type
    error
    Description
    Not found

Request

GET
/reports/summary/{type}
curl --location 'https://gw.onemap8.com/api/reports/summary/<string>?deviceId=<array>&groupId=<array>&from=<date-time>&to=<date-time>&daily=<boolean>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

"<binary>"

GET/reports/trips/{type}

Download the trips report as a spreadsheet or send it by email

Use type=xlsx to download the report, type=mail to deliver it by email asynchronously.

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Path parameters

  • Name
    type
    Type
    string required
    Description

Query Parameters

  • Name
    deviceId
    Type
    array of integer
    Description
  • Name
    groupId
    Type
    array of integer
    Description
  • Name
    from
    Type
    string <date-time> required
    Description
    in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  • Name
    to
    Type
    string <date-time> required
    Description
    in ISO 8601 format. eg. `1963-11-22T18:30:00Z`

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description
    Spreadsheet attachment
  • Name
    204
    Type
    success
    Description
    Report queued for email delivery
  • Name
    401
    Type
    error
    Description
    Unauthorized
  • Name
    404
    Type
    error
    Description
    Not found

Request

GET
/reports/trips/{type}
curl --location 'https://gw.onemap8.com/api/reports/trips/<string>?deviceId=<array>&groupId=<array>&from=<date-time>&to=<date-time>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

"<binary>"

GET/reports/stops/{type}

Download the stops report as a spreadsheet or send it by email

Use type=xlsx to download the report, type=mail to deliver it by email asynchronously.

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Path parameters

  • Name
    type
    Type
    string required
    Description

Query Parameters

  • Name
    deviceId
    Type
    array of integer
    Description
  • Name
    groupId
    Type
    array of integer
    Description
  • Name
    from
    Type
    string <date-time> required
    Description
    in ISO 8601 format. eg. `1963-11-22T18:30:00Z`
  • Name
    to
    Type
    string <date-time> required
    Description
    in ISO 8601 format. eg. `1963-11-22T18:30:00Z`

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description
    Spreadsheet attachment
  • Name
    204
    Type
    success
    Description
    Report queued for email delivery
  • Name
    401
    Type
    error
    Description
    Unauthorized
  • Name
    404
    Type
    error
    Description
    Not found

Request

GET
/reports/stops/{type}
curl --location 'https://gw.onemap8.com/api/reports/stops/<string>?deviceId=<array>&groupId=<array>&from=<date-time>&to=<date-time>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

"<binary>"

GET/reports/devices/{type}

Download the devices report as a spreadsheet or send it by email

Use type=xlsx to download the report, type=mail to deliver it by email asynchronously.

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Path parameters

  • Name
    type
    Type
    string required
    Description

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description
    Spreadsheet attachment
  • Name
    204
    Type
    success
    Description
    Report queued for email delivery
  • Name
    401
    Type
    error
    Description
    Unauthorized
  • Name
    404
    Type
    error
    Description
    Not found

Request

GET
/reports/devices/{type}
curl --location 'https://gw.onemap8.com/api/reports/devices/<string>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

"<binary>"