Vehicles
The Vehicles section provides access to detailed vehicle data within your account. This includes retrieving vehicle lists, specific vehicle details, and mileage statistics. The updated endpoints provide enhanced functionality, including support for pagination and the newly added ManifoldDetails
property for deeper insights into vehicle specifications.
List Vehicles
Endpoint: GET /vehicles
Description:
Retrieve a list of all vehicles in your account. The response includes key details like vehicle ID, VIN, status, mileage, last known location, and additional specifications provided by the new ManifoldDetails
property. Use optional pagination parameters to handle large datasets efficiently.
Headers:
Header | Type | Description |
---|---|---|
x-api-key | String | Required API key for authentication. |
Connection-Id | UUID | Required unique identifier for the connection. |
Query Parameters:
Parameter | Type | Description |
---|---|---|
limit | Integer | Number of results to return per page. Defaults to 10. |
cursor | String | Pagination cursor for the next page of results. |
Response:
{
"status": 200,
"message": "Success",
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"connectionId": "456e1234-e89b-12d3-a456-426614174111",
"vin": "1HGCM82633A123456",
"name": "Vehicle A",
"status": "active",
"mileage": 120000,
"lastLocation": {
"latitude": 37.7749,
"longitude": -122.4194,
"altitude": 15.5,
"speed": 60,
"timestamp": "2024-10-10T12:00:00Z"
},
"manifoldDetails": {
"name": "HONDA Civic",
"make": "HONDA",
"company": "HONDA OF CANADA MFG., A DIVISION OF HONDA CANADA INC.",
"model": "Civic",
"constructionYear": 2013,
"fuelType": "Gasoline",
"bodyClass": "Sedan/Saloon",
"type": "PASSENGER CAR"
}
}
],
"pagination": {
"currentPage": 1,
"totalPages": 5,
"pageSize": 10,
"totalItems": 50
}
}
Response Fields Explained:
- Main Fields:
id
: Unique identifier for the vehicle.connectionId
: ID of the connection to which the vehicle belongs.vin
: Vehicle Identification Number.name
: Optional, human-readable name for easy reference.status
: Current status of the vehicle (e.g., active or inactive).mileage
: Total mileage recorded for the vehicle.- Last Location (Nested):
latitude
: Latitude coordinate of the vehicle's last known location.longitude
: Longitude coordinate of the vehicle's last known location.altitude
: Altitude at the last known location (in meters).speed
: Speed of the vehicle at the last known location (in km/h).timestamp
: Time when the location was recorded (in ISO 8601 format).
- Manifold Details:
name
: Name of the vehicle.make
: Make of the vehicle.company
: Manufacturer of the vehicle.model
: Vehicle model name.constructionYear
: Year the vehicle was manufactured.fuelType
: Type of fuel the vehicle uses (e.g., Gasoline, Diesel, Electric).bodyClass
: Classification of the vehicle body (e.g., Sedan, Truck).type
: Type of the vehicle (e.g. BUS, INCOMPLETE VEHICLE).
- Pagination Metadata:
currentPage
: The current page of the dataset being retrieved.totalPages
: Total number of pages available.pageSize
: Number of items per page.totalItems
: Total number of vehicles available.
Get Vehicle Details
Endpoint: GET /vehicles/{vehicleId}
Description:
Retrieve detailed information for a specific vehicle, identified by its unique vehicleId
. The response includes key details such as VIN, status, mileage, last known location, and additional specifications provided by the ManifoldDetails
property.
Path Parameters:
Parameter | Type | Description |
---|---|---|
vehicleId | UUID | Unique ID of the vehicle to retrieve details. |
Headers:
Header | Type | Description |
---|---|---|
x-api-key | String | Required API key for authentication. |
Connection-Id | UUID | Required unique identifier for the connection. |
Response:
{
"status": 200,
"message": "Success",
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"connectionId": "456e1234-e89b-12d3-a456-426614174111",
"vin": "1HGCM82633A123456",
"name": "Vehicle A",
"status": "active",
"mileage": 120000,
"lastLocation": {
"latitude": 37.7749,
"longitude": -122.4194,
"altitude": 15.5,
"speed": 60,
"timestamp": "2024-10-10T12:00:00Z"
},
"manifoldDetails": {
"name": "HONDA Civic",
"make": "HONDA",
"company": "HONDA OF CANADA MFG., A DIVISION OF HONDA CANADA INC.",
"model": "Civic",
"constructionYear": 2013,
"fuelType": "Gasoline",
"bodyClass": "Sedan/Saloon",
"type": "PASSENGER CAR"
}
}
}
Response Fields Explained:
Same as the fields explained in the List Vehicles endpoint.
Historical Vehicle Distance Driven
Endpoint: GET /vehicles/{vehicleId}/distance-driven
Description:
Retrieve historical distance data for a specific vehicle, allowing you to analyze the mileage covered over a specified time range.
Path Parameters:
Parameter | Type | Description |
---|---|---|
vehicleId | UUID | Unique ID of the vehicle to retrieve distance data. |
Query Parameters:
Parameter | Type | Description |
---|---|---|
from | date-time | Start date-time for the distance data range. |
to | date-time | End date-time for the distance data range. |
Headers:
Header | Type | Description |
---|---|---|
x-api-key | String | Required API key for authentication. |
Connection-Id | UUID | Required unique identifier for the connection. |
Response:
{
"status": 200,
"message": "Success",
"data": {
"distance": 150.5,
"time": "2024-10-13T15:28:33.692Z"
}
}
Response Fields Explained:
distance
: Total distance driven by the vehicle during the specified period (in kilometers).time
: Timestamp for the distance data in ISO 8601 format.
Example Requests Using cURL
List Vehicles
curl --request GET \
--url https://api.analytics.autos/vehicles \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Connection-Id: YOUR-CONNECTION-ID'
Get Vehicle Details
curl --request GET \
--url https://api.analytics.autos/vehicles/{vehicleId} \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Connection-Id: YOUR-CONNECTION-ID'
Historical Vehicle Distance Driven
curl --request GET \
--url https://api.analytics.autos/vehicles/{vehicleId}/distance-driven?from=2024-01-01T00:00:00Z&to=2024-01-31T23:59:59Z \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Connection-Id: YOUR-CONNECTION-ID'
Updated 7 days ago