Positions
The Positions API allows for retrieving and managing position data from devices, including fetching positions with various filters and deleting position records within specified time ranges.
Data Schema
Field | Type | Description |
---|---|---|
id |
integer |
Position ID |
deviceId |
integer |
Device ID that reported the position |
protocol |
string |
Transmission protocol used |
deviceTime |
string |
Time recorded by device (ISO 8601) |
fixTime |
string |
Time of position fix (ISO 8601) |
serverTime |
string |
Server receipt time (ISO 8601) |
outdated |
boolean |
Position outdated status |
valid |
boolean |
Position validity status |
latitude |
number |
Position latitude |
longitude |
number |
Position longitude |
altitude |
number |
Position altitude |
speed |
number |
Speed in knots |
course |
number |
Movement direction |
address |
string |
Location address |
accuracy |
number |
Position accuracy |
network |
object |
Network information |
geofenceIds |
array |
Associated geofence IDs |
attributes |
object |
Additional position attributes |
Fetch Positions
Retrieves position data based on specified filters and parameters.
🛠Endpoint:
GET /positions
Authorization:
- Requires Basic Authentication (
basicAuth
)
Query Parameters:
Parameter | Type | Description |
---|---|---|
deviceId |
integer |
Filter positions by device ID. Requires from and to parameters when used. |
from |
string |
Start date/time for filtering (ISO 8601 format, e.g., 2025-02-18T07:22:23Z ) |
to |
string |
End date/time for filtering (ISO 8601 format, e.g., 2025-02-18T07:22:23Z ) |
id |
integer |
Fetch specific positions. Multiple id parameters can be passed. |
cURL Request:
curl -u username:password -X GET "https://itsochvts.com/api/positions" \
-H "Content-Type: application/json"
200 OK - Response Body
[
{
"id": 0,
"deviceId": 0,
"protocol": "string",
"deviceTime": "2025-02-18T07:22:23Z",
"fixTime": "2025-02-18T07:22:23Z",
"serverTime": "2025-02-18T07:22:23Z",
"outdated": true,
"valid": true,
"latitude": 0,
"longitude": 0,
"altitude": 0,
"speed": 0,
"course": 0,
"address": "string",
"accuracy": 0,
"network": {},
"geofenceIds": [],
"attributes": {}
}
]
Delete Positions
Deletes position records for a specific device within a time range.
🛠Endpoint:
DELETE /positions
Authorization:
- Requires Basic Authentication (
basicAuth
)
Query Parameters:
Parameter | Type | Description |
---|---|---|
deviceId |
integer |
Device ID for position deletion (required) |
from |
string |
Start of deletion range (ISO 8601) (required) |
to |
string |
End of deletion range (ISO 8601) (required) |
cURL Request:
curl -u username:password -X DELETE "https://itsochvts.com/api/positions?deviceId=123&from=2025-02-18T00:00:00Z&to=2025-02-18T23:59:59Z" \
-H "Content-Type: application/json"