Reports
Generation of reports
The Reports Model
Onemap8 can serve 5 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
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
Arrayof Route report
Request
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": { }
},
{
...
}
]
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
Arrayof Events report
Request
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": { }
},
{
...
}
]
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
Arrayof Summary report
Request
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
},
{
...
}
]
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
Arrayof Trips report
Request
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"
},
{
...
}
]
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
Arrayof Stops report
Request
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
},
{
...
}
]