Skip to main content
GET
/
vehiculo
List Vehicles
curl --request GET \
  --url https://api.example.com/vehiculo
{
  "success": false,
  "message": "Error interno del servidor",
  "timestamp": "2024-01-15T10:30:00Z"
}

Endpoints

There are two endpoints for listing vehicles:
  1. Paginated List: GET /vehiculo - Returns paginated results
  2. 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

pagina
integer
default:"1"
Page number (must be ≥ 1)Example: 1
por_pagina
integer
default:"10"
Records per page (must be between 1 and 100)Example: 10
placa
string
Filter by license plate (partial match)Example: "P503"
marca
string
Filter by brand (partial match)Example: "TOYOTA"
modelo
string
Filter by model (partial match)Example: "HILUX"
idClaseVehiculo
integer
Filter by vehicle class ID (exact match)Example: 1
idEstadoVehiculo
integer
Filter by vehicle state ID (exact match)Example: 1
busqueda
string
General search across plate, brand, model, and colorExample: "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

success
boolean
Indicates if the operation was successful
message
string
Success message: “Listado de vehículos obtenido exitosamente”
data
object
Paginated vehicle data
timestamp
string
Response timestamp

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):
placa
string
Filter by license plate (partial match)
marca
string
Filter by brand (partial match)
modelo
string
Filter by model (partial match)
idClaseVehiculo
integer
Filter by vehicle class ID (exact match)
idEstadoVehiculo
integer
Filter by vehicle state ID (exact match)
busqueda
string
General search across plate, brand, model, and color

Response

success
boolean
Indicates if the operation was successful
message
string
Success message: “Listado completo de vehículos obtenido exitosamente”
data
array
Array of all vehicle objects matching the filters (ordered by plate)
timestamp
string
Response timestamp

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

{
  "success": false,
  "message": "Error interno del servidor",
  "timestamp": "2024-01-15T10:30:00Z"
}

Build docs developers (and LLMs) love