Skip to main content
GET
/
vehiculo
/
{id}
Get Vehicle
curl --request GET \
  --url https://api.example.com/vehiculo/{id}
{
  "success": false,
  "message": "No se encontró el vehículo con ID 999",
  "timestamp": "2024-01-15T10:30:00Z"
}

Endpoint

method
string
default:"GET"
GET
endpoint
string
/vehiculo/

Description

Retrieves a specific vehicle by its ID with all details including resolved foreign key names. Returns complete vehicle information including relationships with vehicle class, state, fuel type, default driver, and assigned department.

Path Parameters

id_vehiculo
integer
required
Unique identifier of the vehicle to retrieveExample: 1

Response

success
boolean
Indicates if the operation was successful
message
string
Success message: “Vehículo obtenido exitosamente”
data
object
Complete vehicle object with all fields and resolved foreign key names
timestamp
string
Response timestamp

Example Request

GET /vehiculo/1

Example Response

{
  "success": true,
  "message": "Vehículo obtenido exitosamente",
  "data": {
    "Id": 1,
    "Placa": "P503067",
    "Marca": "TOYOTA",
    "Modelo": "HILUX",
    "Anio": 2020,
    "Color": "BLANCO",
    "NumeroMotor": "1GRFE123456",
    "NumeroChasis": "JT123456789012345",
    "NumeroVin": "JT123456789012345",
    "CapacidadPasajeros": 5,
    "CapacidadCombustibleGalones": 80.0,
    "KilometrajeActual": 15000,
    "FechaUltimaRevision": "2024-01-15",
    "FechaProximoMantenimiento": "2024-07-15",
    "FechaTarjetaCirculacion": "2023-12-01",
    "NumeroPolizaSeguro": "POL123456789",
    "FechaVencimientoSeguro": "2025-12-01",
    "Observaciones": "Vehículo en excelente estado",
    "Eliminado": false,
    "FechaHoraCreacion": "2024-01-15T10:30:00Z",
    "FechaHoraActualizacion": "2024-01-20T14:45:00Z",
    "IdClaseVehiculo": 1,
    "NombreClaseVehiculo": "Pick-up",
    "IdEstadoVehiculo": 1,
    "NombreEstadoVehiculo": "Activo",
    "IdTipoCombustible": 1,
    "NombreTipoCombustible": "Diesel",
    "IdMotoristaPorDefecto": 10,
    "NombreMotoristaPorDefecto": "Juan Pérez",
    "IdDepartamentoAsignado": 2,
    "NombreDepartamentoAsignado": "Logística"
  },
  "timestamp": "2024-01-15T10:30:00Z"
}

Features

Complete Details

Returns all vehicle fields including optional ones

Resolved FK Names

Foreign key IDs include their corresponding names

Timestamps

Includes creation and last update timestamps

Relationships

Shows all relationships: class, state, fuel, driver, department

Error Responses

{
  "success": false,
  "message": "No se encontró el vehículo con ID 999",
  "timestamp": "2024-01-15T10:30:00Z"
}

Use Cases

  • View complete vehicle details
  • Display vehicle information in detail pages
  • Pre-populate edit forms with current data
  • Verify vehicle status and relationships
  • Audit vehicle history and changes

Build docs developers (and LLMs) love