Positions
Without any params, it returns a list of last known positions for all the user's Devices. from and to fields are not required with id.
We strongly recommend using our WebSocket API instead of periodically polling positions endpoint.
The Positions Model
A position is represented by the following schema:
Scheme
- Name
id- Type
- integer
- Description
- Name
deviceId- Type
- integer
- Description
- Name
protocol- Type
- string
- Description
- Name
deviceTime- Type
- string
- Description
- in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
- Name
fixTime- Type
- string
- Description
- in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
- Name
serverTime- Type
- string
- Description
- in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
- Name
outdated- Type
- boolean
- Description
- Name
valid- Type
- boolean
- Description
- Name
latitude- Type
- number
- Description
- Name
longitude- Type
- number
- Description
- Name
altitude- Type
- number
- Description
- Name
speed- Type
- number
- Description
- in knots
- Name
course- Type
- number
- Description
- Name
address- Type
- string
- Description
- Name
accuracy- Type
- number
- Description
- Name
network- Type
- object
- Description
- Name
geofenceIds- Type
- array
- Description
- Name
attributes- Type
- object
- Description
Retrieve a list of positions
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
- integer
- Description
deviceIdis optional, but requires thefromandtoparameters when used
- Name
from- Type
- string
- Description
in IS0 8601 format. eg.
1963-11-22T18:30:00Z
- Name
to- Type
- string
- Description
in IS0 8601 format. eg.
1963-11-22T18:30:00Z
- Name
id- Type
- integer
- Description
To retrieve one or more positions. Multiple params can be passed like
id=31&id=42
Response schema
- Name
application/json- Type
- schema
- Description
Responses
- Name
200- Type
- success
- Description
Arrayof Position
Request
curl --location 'https://gw.onemap8.com/api/positions?deviceId=%3Cinteger%3E&from=%3CdateTime%3E&to=%3CdateTime%3E&id=%3Cinteger%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": { }
},
{
...
}
]
Deletes all the Positions of a device in the time span specified
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
- integer
- Description
deviceIdis optional, but requires thefromandtoparameters when used
- Name
from- Type
- string
- Description
in IS0 8601 format. eg.
1963-11-22T18:30:00Z
- Name
to- Type
- string
- Description
in IS0 8601 format. eg.
1963-11-22T18:30:00Z
Responses
- Name
204- Type
- success
- Description
No content
- Name
400- Type
- error
- Description
Bad request
Request
curl --location --request DELETE 'https://gw.onemap8.com/api/positions?deviceId=%3Cinteger%3E&from=%3CdateTime%3E&to=%3CdateTime%3E' \
--header 'Authorization: Basic {your_access_token}'
Response
No content