Assets API
Manage trackable entities and monitor their real-time locations.
Overview
Assets represent entities that need to be tracked (vehicles, equipment, personnel, etc.). Each asset can have custom properties for grouping and monitoring, and maintains location history for analysis.
Asset Object Fields
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier for the asset. Auto-generated UUID if not provided. |
name | String | Human-readable name for the asset. |
description | String | Detailed description of the asset. |
state | String | Current state: active (updated within 7 days) or inactive (no updates for 7+ days). |
properties | Object | Custom JSON properties for grouping and monitoring (e.g., department, vehicle_type, zone). |
created_at | Integer | Unix timestamp when the asset was created. |
updated_at | Integer | Unix timestamp when the asset was last updated. |
user_id | Integer | The user ID that will send location updates for this asset. |
Add Asset
Create a new asset with identifying properties.
-
Endpoint:
POST /add_asset -
Headers:
Authorization: YOUR_API_KEYContent-Type: application/jsonAccept: application/json
-
Request Body:
{
"p_id": "vehicle_101",
"p_name": "Delivery Van 101",
"p_description": "Primary delivery vehicle for downtown routes",
"p_properties": {
"vehicle_type": "van",
"department": "logistics",
"zone": "downtown"
},
"p_state": "active",
"p_type": "user",
"p_user_id": 1001
}
Parameters:
p_id(optional) - Custom identifier (UUID auto-generated if not provided)p_name(optional) - Asset namep_description(optional) - Detailed descriptionp_properties(optional) - Custom JSON properties for grouping and monitoringp_state(optional) -activeorinactive(default:inactive)p_type- Asset type (currently onlyusersupported)p_user_id- User ID that sends location updates through the SDK (special configuration required in the client SDK to enable location tracking)
Asset States:
- active - Location updated within last 7 days
- inactive - No location updates for 7+ days
Get Assets
Retrieve asset information by IDs or properties.
Get by IDs
-
Endpoint:
GET /get_assets_by_ids -
Headers:
Authorization: YOUR_API_KEYContent-Type: application/jsonAccept: application/json
-
Request Body:
{
"p_ids": ["truck_205"]
}
- Response Body: (code
200 OK)
{
"assets": [
{
"id": "truck_205",
"name": "Heavy Duty Truck 205 - Long Haul",
"state": "active",
"created_at": 1766480766,
"properties": {
"zone": "national",
"fuel_type": "diesel",
"department": "freight",
"capacity_kg": 5000,
"gps_upgraded": 1,
"vehicle_type": "truck",
"license_plate": "XYZ-789",
"driver_assigned": "Mike Johnson",
"last_inspection": "2025-12-20",
"trailer_attached": 1
},
"updated_at": 1766499343,
"description": "Long-haul freight truck for interstate deliveries - recently upgraded",
"gps_device_id": null,
"last_location": {
"speed": 4.48,
"bearing": 201.2,
"accuracy": 0.5,
"altitude": null,
"timestamp": 1768464078,
"coordinates": [
10.749773125,
59.926084062
]
}
}
]
}
Get by Properties
-
Endpoint:
GET /get_assets_by_properties -
Headers:
Authorization: YOUR_API_KEYContent-Type: application/jsonAccept: application/json
-
Request Body:
{
"p_properties": {
"department": "logistics",
"vehicle_type": "van"
},
"p_filter": "all_of",
"p_page_no": 1,
"p_entries_per_page": 20
}
Filter Types:
-
all_of- Asset must have all specified properties -
any_of- Asset must have at least one specified property -
Response Body: (code
200 OK)
{
"assets": [
{
"id": "vehicle_101",
"name": "Delivery Van 101 - Updated",
"state": "inactive",
"created_at": 1766480112,
"properties": {
"zone": "downtown",
"department": "logistics",
"capacity_kg": 1000,
"vehicle_type": "van",
"license_plate": "ABC-123"
},
"updated_at": 1766487603,
"description": "Primary delivery vehicle for downtown and suburban routes",
"gps_device_id": null,
"last_location": {
"speed": 8,
"bearing": 78,
"accuracy": 0.5,
"altitude": null,
"timestamp": 1767865038,
"coordinates": [
25.618200938,
45.653289062
]
}
}
],
"page": {
"page_no": 1,
"has_more": false,
"total_pages": 1,
"total_entries": 1,
"offset_entries": 0,
"entries_per_page": 20
}
}
Search Assets in Areas
Find assets within geographical boundaries.
Search in Circle Area
-
Endpoint:
GET /search_assets_in_area_circle -
Headers:
Authorization: YOUR_API_KEYContent-Type: application/jsonAccept: application/json
-
Request Body:
{
"p_center_lon": 25.614433,
"p_center_lat": 45.65382,
"p_radius_m": 1000,
"p_properties": {},
"p_filter": "any_of",
"p_page_no": 1,
"p_entries_per_page": 20
}
Search in Envelope (Rectangle) Area
-
Endpoint:
GET /search_assets_in_area_envelope -
Headers:
Authorization: YOUR_API_KEYContent-Type: application/jsonAccept: application/json
-
Request Body:
{
"p_lonmin": 25.599977,
"p_latmin": 45.642448,
"p_lonmax": 25.63365,
"p_latmax": 45.657558
}
Search in Polygon Area
-
Endpoint:
GET /search_assets_in_area_polygon -
Headers:
Authorization: YOUR_API_KEYContent-Type: application/jsonAccept: application/json
-
Request Body:
{
"p_coordinates": [
[25.566809, 45.673419],
[25.560272, 45.658444],
[25.634891, 45.631630],
...
]
}
- Response Body: (code
200 OK)
{
"assets": [
{
"id": "bike_301",
"name": "Courier Bike 301",
"state": "active",
"created_at": 1766481314,
"properties": {
"zone": "city_center",
"department": "express_delivery",
"asset_number": "BK-301",
"vehicle_type": "e_bike",
"battery_range_km": 80
},
"updated_at": 1766481314,
"description": "Electric bike for express urban deliveries",
"gps_device_id": null,
"last_location": {
"speed": 6,
"bearing": 25,
"accuracy": 0.5,
"altitude": null,
"timestamp": 1766493607,
"coordinates": [
25.608245938,
45.64818
]
}
},
...
],
"page": {
"total_entries": 3,
"offset_entries": 0,
"total_pages": 1,
"page_no": 1,
"entries_per_page": 20,
"has_more": false
}
}
Location History
Retrieve historical location data for an asset.
-
Endpoint:
GET /get_locations_of_asset_in_interval -
Headers:
Authorization: YOUR_API_KEYContent-Type: application/jsonAccept: application/json
-
Request Body:
{
"p_asset_id": "bike_301",
"p_start_time": 1766493579,
"p_end_time": 1766493607,
"p_page_no": 1,
"p_entries_per_page": 20
}
- Response Body: (code
200 OK)
{
"locations_history": [
{
"speed": 6,
"bearing": 25,
"accuracy": 0.5,
"altitude": null,
"location": [
25.608245938,
45.64818
],
"timestamp": 1766493607
},
{
"speed": 6,
"bearing": 25,
"accuracy": 0.5,
"altitude": null,
"location": [
25.60871,
45.647718125
],
"timestamp": 1766493579
}
],
"page": {
"total_entries": 2,
"offset_entries": 0,
"total_pages": 1,
"page_no": 1,
"entries_per_page": 20,
"has_more": false
}
}
Get Last Tracked Location of Asset
Retrieve the most recent location data for a specific asset.
-
Endpoint:
GET /get_last_location_of_asset -
Headers:
Authorization: YOUR_API_KEYContent-Type: application/jsonAccept: application/json
-
Request Body:
{
"p_asset_id": "vehicle_101"
}
- Response Body: (code
200 OK)
{
"asset_id": "vehicle_101",
"location": {
"longitude": 25.612887,
"latitude": 45.647265,
"timestamp": 1766500000,
"speed": 15.5,
"bearing": 180,
"accuracy": 5.0,
"altitude": 250.0
}
}
Response Fields:
longitude- GPS longitude coordinatelatitude- GPS latitude coordinatetimestamp- Unix timestamp (seconds since epoch)speed- Speed in meters per secondbearing- Direction in degrees (0-360, where 0 is North)accuracy- Location accuracy in metersaltitude- Elevation in meters (optional)
Use Cases:
- Real-time fleet tracking dashboards
- Current asset status displays
- Route optimization based on current positions
- Emergency response coordination
Update Asset
Modify asset properties and metadata.
-
Endpoint:
POST /update_asset -
Headers:
Authorization: YOUR_API_KEYContent-Type: application/jsonAccept: application/json
-
Request Body:
{
"p_id": "vehicle_101",
"p_name": "Delivery Van 101 - Updated",
"p_description": "Primary delivery vehicle for downtown and suburban routes",
"p_properties": {
"zone": "expanded_area"
}
}
- Response Body: (code
200 OK)
{
"id": "truck_205",
"error": ""
}
Delete Assets
Remove assets from the system.
-
Endpoint:
DELETE /delete_assets -
Headers:
Authorization: YOUR_API_KEYContent-Type: application/jsonAccept: application/json
-
Request Body:
{
"p_ids": ["test_asset_1", "test_asset_2"]
}
- Response Body: (code
200 OK)
{
"deleted_ids": [
"test_asset_1",
"test_asset_2"
]
}
Notes
- Use descriptive properties for grouping (department, zone, type)
- Only active assets appear in spatial searches
- Use properties for monitor assignment to assets and filtering
API Limits
- For requests that support pagination, entries per page can be set to maximum 1000