Vehicles

Retrieve all vehicles

get

Retrieve vehicles for a company

Query parameters
per_pageintegerOptional

limit of records per page

Example: 10
pageintegerOptional

page number

Example: 2
typestringOptional

This parameter is used to filter by vehicle type.(Light-Duty Passenger Car, Light-Duty Passenger Truck,Electric Passenger Car,Heavy-Duty Truck (Semi),Specialty,Forklift,Trailer,Airplane,Recreational Vehicle,Excavator,Non-EPA Recognized Passenger Vehicle,Other)

Example: Light-Duty Passenger Car
modelstringOptional

This field is used to filter by vehicle model. (LIKE)

Example: Hay
sort_bystringOptional

This parameter is used to sort the records by a specific field (model,year,quantity,created_at,name_branch)

Example: year
sort_dirstringOptional

Order type(asc or desc)

Example: asc
Responses
200

Successful operation

application/json
get
GET /api/vehicles HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
  "status": "Ok",
  "message": "Success",
  "data": [
    {
      "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
      "company_id": "996501dd-e5a6-473f-9651-f0dc530df50d",
      "type": "Heavy-Duty Truck (Semi)",
      "model": "Mr. Rolando Hayes DDS",
      "make": "est",
      "year": "2019",
      "quantity": "6509",
      "updated_at": "2023-06-12T17:30:21.000000Z",
      "created_at": "2023-06-12T17:30:21.000000Z"
    }
  ],
  "meta": {
    "pagination": {
      "current": "1",
      "last_page": "1",
      "per_page": "10",
      "total": "6"
    }
  }
}

Store a vehicle

post

Store a vehicle for a company

Body

create vehicles request body data

typeanyRequired

type of the Vehicle

Example: Heavy-Duty Truck (Semi)
modelanyRequired

model of the Vehicle

Example: Mr. Rolando Hayes DDS
makeanyRequired

make of the Vehicle

Example: est
quantitystringRequired

quantity of the Vehicle

Example: 2019
yearintegerOptional

year of the Vehicle

Example: 6509
Responses
200

Successful operation

application/json
post
POST /api/vehicles HTTP/1.1
Host: app.greenplaces.com
Content-Type: application/json
Accept: */*
Content-Length: 109

{
  "type": "Heavy-Duty Truck (Semi)",
  "model": "Mr. Rolando Hayes DDS",
  "make": "est",
  "quantity": "2019",
  "year": 6509
}
{
  "status": "Ok",
  "message": "Success",
  "data": {
    "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "company_id": "996501dd-e5a6-473f-9651-f0dc530df50d",
    "type": "Heavy-Duty Truck (Semi)",
    "model": "Mr. Rolando Hayes DDS",
    "make": "est",
    "year": "2019",
    "quantity": "6509",
    "updated_at": "2023-06-12T17:30:21.000000Z",
    "created_at": "2023-06-12T17:30:21.000000Z"
  },
  "meta": {}
}

Get vehicle

get

obtain information about a vehicle

Path parameters
idstringRequired

Id of the vehicle

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Responses
200

Successful operation

application/json
get
GET /api/vehicles/{id} HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
  "status": "Ok",
  "message": "Success",
  "data": {
    "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "company_id": "996501dd-e5a6-473f-9651-f0dc530df50d",
    "type": "Heavy-Duty Truck (Semi)",
    "model": "Mr. Rolando Hayes DDS",
    "make": "est",
    "year": "2019",
    "quantity": "6509",
    "updated_at": "2023-06-12T17:30:21.000000Z",
    "created_at": "2023-06-12T17:30:21.000000Z"
  },
  "meta": {}
}

Put vehicle

put

updated vehicle

Path parameters
idstringRequired

Id of the vehicle

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Body

updated vehicles request body data

typeanyRequired

type of the Vehicle

Example: Heavy-Duty Truck (Semi)
modelanyRequired

model of the Vehicle

Example: Mr. Rolando Hayes DDS
makeanyRequired

make of the Vehicle

Example: est
quantitystringRequired

quantity of the Vehicle

Example: 2019
yearintegerOptional

year of the Vehicle

Example: 6509
Responses
200

Successful operation

application/json
put
PUT /api/vehicles/{id} HTTP/1.1
Host: app.greenplaces.com
Content-Type: application/json
Accept: */*
Content-Length: 109

{
  "type": "Heavy-Duty Truck (Semi)",
  "model": "Mr. Rolando Hayes DDS",
  "make": "est",
  "quantity": "2019",
  "year": 6509
}
{
  "status": "Ok",
  "message": "Success",
  "data": {
    "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "company_id": "996501dd-e5a6-473f-9651-f0dc530df50d",
    "type": "Heavy-Duty Truck (Semi)",
    "model": "Mr. Rolando Hayes DDS",
    "make": "est",
    "year": "2019",
    "quantity": "6509",
    "updated_at": "2023-06-12T17:30:21.000000Z",
    "created_at": "2023-06-12T17:30:21.000000Z"
  },
  "meta": {}
}

Delete vehicle

delete

remove vehicle

Path parameters
idstringRequired

Id of the vehicle

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Responses
200

Successful operation

application/json
delete
DELETE /api/vehicles/{id} HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
  "status": "Ok",
  "message": "Success",
  "data": null,
  "meta": {}
}