Endpoints
There are two endpoints for listing vehicles:
Paginated List : GET /vehiculo - Returns paginated results
Complete List : GET /vehiculo/todos/lista - Returns all records without pagination
GET /vehiculo (Paginated)
Description
Lists active vehicles with pagination and multiple filter options. Ideal for displaying vehicles in a user interface with page navigation.
Query Parameters
Page number (must be ≥ 1) Example : 1
Records per page (must be between 1 and 100) Example : 10
Filter by license plate (partial match) Example : "P503"
Filter by brand (partial match) Example : "TOYOTA"
Filter by model (partial match) Example : "HILUX"
Filter by vehicle class ID (exact match) Example : 1
Filter by vehicle state ID (exact match) Example : 1
General search across plate, brand, model, and color Example : "toyota blanco"
Filter Behavior
Search Types
Partial Match : placa, marca, modelo, busqueda - These filters search for partial matches (case-insensitive)
Exact Match : idClaseVehiculo, idEstadoVehiculo - These filters require exact ID matches
General Search : busqueda searches across multiple fields: plate, brand, model, and color
Response
Indicates if the operation was successful
Success message: “Listado de vehículos obtenido exitosamente”
Paginated vehicle data Total number of vehicles matching the filters
Array of vehicle objects Show Vehicle Object Properties
Vehicle class name (resolved)
Vehicle state name (resolved)
Example Request
GET /vehiculo?pagina= 1 & por_pagina = 10 & marca = TOYOTA & idEstadoVehiculo = 1
Example Response
{
"success" : true ,
"message" : "Listado de vehículos obtenido exitosamente" ,
"data" : {
"total" : 25 ,
"pagina" : 1 ,
"porPagina" : 10 ,
"registros" : [
{
"Id" : 1 ,
"Placa" : "P503067" ,
"Marca" : "TOYOTA" ,
"Modelo" : "HILUX" ,
"Anio" : 2020 ,
"Color" : "BLANCO" ,
"IdClaseVehiculo" : 1 ,
"NombreClaseVehiculo" : "Pick-up" ,
"IdEstadoVehiculo" : 1 ,
"NombreEstadoVehiculo" : "Activo" ,
"KilometrajeActual" : 15000 ,
"Eliminado" : false
},
{
"Id" : 2 ,
"Placa" : "P503068" ,
"Marca" : "TOYOTA" ,
"Modelo" : "LAND CRUISER" ,
"Anio" : 2021 ,
"Color" : "NEGRO" ,
"IdClaseVehiculo" : 2 ,
"NombreClaseVehiculo" : "SUV" ,
"IdEstadoVehiculo" : 1 ,
"NombreEstadoVehiculo" : "Activo" ,
"KilometrajeActual" : 8500 ,
"Eliminado" : false
}
]
},
"timestamp" : "2024-01-15T10:30:00Z"
}
GET /vehiculo/todos/lista (Complete List)
Description
Lists all active vehicles without pagination. Results are ordered by license plate. Use this endpoint when you need the complete dataset (e.g., for exports or dropdowns).
This endpoint returns all records at once. Use with caution if you have a large number of vehicles.
Query Parameters
Supports the same filters as the paginated endpoint (except pagina and por_pagina):
Filter by license plate (partial match)
Filter by brand (partial match)
Filter by model (partial match)
Filter by vehicle class ID (exact match)
Filter by vehicle state ID (exact match)
General search across plate, brand, model, and color
Response
Indicates if the operation was successful
Success message: “Listado completo de vehículos obtenido exitosamente”
Array of all vehicle objects matching the filters (ordered by plate)
Example Request
GET /vehiculo/todos/lista?idEstadoVehiculo= 1
Example Response
{
"success" : true ,
"message" : "Listado completo de vehículos obtenido exitosamente" ,
"data" : [
{
"Id" : 1 ,
"Placa" : "P503067" ,
"Marca" : "TOYOTA" ,
"Modelo" : "HILUX" ,
"Anio" : 2020 ,
"Color" : "BLANCO" ,
"IdClaseVehiculo" : 1 ,
"NombreClaseVehiculo" : "Pick-up" ,
"IdEstadoVehiculo" : 1 ,
"NombreEstadoVehiculo" : "Activo" ,
"KilometrajeActual" : 15000
},
{
"Id" : 2 ,
"Placa" : "P503068" ,
"Marca" : "TOYOTA" ,
"Modelo" : "LAND CRUISER" ,
"Anio" : 2021 ,
"Color" : "NEGRO" ,
"IdClaseVehiculo" : 2 ,
"NombreClaseVehiculo" : "SUV" ,
"IdEstadoVehiculo" : 1 ,
"NombreEstadoVehiculo" : "Activo" ,
"KilometrajeActual" : 8500
}
],
"timestamp" : "2024-01-15T10:30:00Z"
}
Use Cases
Paginated UI Use GET /vehiculo for displaying vehicles in a paginated table or list
Dropdown Lists Use GET /vehiculo/todos/lista for populating dropdown selections
Data Export Use GET /vehiculo/todos/lista for exporting all vehicle data
Search Results Use GET /vehiculo with filters for search functionality
Error Responses
500 Internal Server Error
{
"success" : false ,
"message" : "Error interno del servidor" ,
"timestamp" : "2024-01-15T10:30:00Z"
}