AlphaAlpha Docs

Vehicles

API calls for vehicles

Create vehicle

POST
/vehicles
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:18080/api/v1/vehicles" \  -H "Content-Type: application/json" \  -d '{    "brand": "string",    "color": "string",    "fuelType": "PETROL",    "licensePlate": "string",    "mileage": 0,    "mileageUnit": "KM",    "model": "string",    "type": "CAR",    "year": 0  }'
{
  "averageFuelConsumption": 0.1,
  "brand": "string",
  "capacity": {
    "height": 0.1,
    "length": 0.1,
    "seats": 0,
    "weight": 0.1,
    "width": 0.1
  },
  "color": "string",
  "costOverDistanceDriven": 0.1,
  "created": "2019-08-24T14:15:22Z",
  "createdBy": "string",
  "currencyUnit": "string",
  "fuelHistory": [
    {
      "amount": 0.1,
      "date": "2019-08-24T14:15:22Z",
      "fuelConsumption": 0.1,
      "id": "string",
      "mileage": 0.1,
      "price": 0.1,
      "user": "string"
    }
  ],
  "fuelType": "PETROL",
  "id": "string",
  "licensePlate": "string",
  "location": {
    "address": {
      "city": "string",
      "country": "string",
      "houseNumber": "string",
      "id": "string",
      "latitude": 0.1,
      "longitude": 0.1,
      "postalCode": "string",
      "street": "string"
    },
    "coordinate": {
      "latitude": -90,
      "longitude": -180
    },
    "name": "string"
  },
  "locationHistory": [
    {
      "date": "2019-08-24T14:15:22Z",
      "id": "string",
      "location": {
        "address": {
          "city": "string",
          "country": "string",
          "houseNumber": "string",
          "id": "string",
          "latitude": 0.1,
          "longitude": 0.1,
          "postalCode": "string",
          "street": "string"
        },
        "coordinate": {
          "latitude": -90,
          "longitude": -180
        },
        "name": "string"
      }
    }
  ],
  "mileage": 0,
  "mileageUnit": "KM",
  "model": "string",
  "tenantId": "string",
  "type": "CAR",
  "updated": "2019-08-24T14:15:22Z",
  "updatedBy": "string",
  "vin": "string",
  "year": 0
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Delete by list of ids in current tenant

DELETE
/vehicles
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X DELETE "http://localhost:18080/api/v1/vehicles" \  -H "Content-Type: application/json" \  -d '[    "string"  ]'
Empty
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Find by list of ids in current tenant

GET
/vehicles/find
AuthorizationBearer <token>

In: header

Query Parameters

ids*array<>

Response Body

application/json

application/json

application/json

application/json

curl -X GET "http://localhost:18080/api/v1/vehicles/find?ids=string"
[
  {
    "averageFuelConsumption": 0.1,
    "brand": "string",
    "capacity": {
      "height": 0.1,
      "length": 0.1,
      "seats": 0,
      "weight": 0.1,
      "width": 0.1
    },
    "color": "string",
    "costOverDistanceDriven": 0.1,
    "created": "2019-08-24T14:15:22Z",
    "createdBy": "string",
    "currencyUnit": "string",
    "fuelHistory": [
      {
        "amount": 0.1,
        "date": "2019-08-24T14:15:22Z",
        "fuelConsumption": 0.1,
        "id": "string",
        "mileage": 0.1,
        "price": 0.1,
        "user": "string"
      }
    ],
    "fuelType": "PETROL",
    "id": "string",
    "licensePlate": "string",
    "location": {
      "address": {
        "city": "string",
        "country": "string",
        "houseNumber": "string",
        "id": "string",
        "latitude": 0.1,
        "longitude": 0.1,
        "postalCode": "string",
        "street": "string"
      },
      "coordinate": {
        "latitude": -90,
        "longitude": -180
      },
      "name": "string"
    },
    "locationHistory": [
      {
        "date": "2019-08-24T14:15:22Z",
        "id": "string",
        "location": {
          "address": {
            "city": "string",
            "country": "string",
            "houseNumber": "string",
            "id": "string",
            "latitude": 0.1,
            "longitude": 0.1,
            "postalCode": "string",
            "street": "string"
          },
          "coordinate": {
            "latitude": -90,
            "longitude": -180
          },
          "name": "string"
        }
      }
    ],
    "mileage": 0,
    "mileageUnit": "KM",
    "model": "string",
    "tenantId": "string",
    "type": "CAR",
    "updated": "2019-08-24T14:15:22Z",
    "updatedBy": "string",
    "vin": "string",
    "year": 0
  }
]
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Find all for current tenant

GET
/vehicles/find-all
AuthorizationBearer <token>

In: header

Response Body

application/json

application/json

application/json

application/json

curl -X GET "http://localhost:18080/api/v1/vehicles/find-all"
[
  {
    "averageFuelConsumption": 0.1,
    "brand": "string",
    "capacity": {
      "height": 0.1,
      "length": 0.1,
      "seats": 0,
      "weight": 0.1,
      "width": 0.1
    },
    "color": "string",
    "costOverDistanceDriven": 0.1,
    "created": "2019-08-24T14:15:22Z",
    "createdBy": "string",
    "currencyUnit": "string",
    "fuelHistory": [
      {
        "amount": 0.1,
        "date": "2019-08-24T14:15:22Z",
        "fuelConsumption": 0.1,
        "id": "string",
        "mileage": 0.1,
        "price": 0.1,
        "user": "string"
      }
    ],
    "fuelType": "PETROL",
    "id": "string",
    "licensePlate": "string",
    "location": {
      "address": {
        "city": "string",
        "country": "string",
        "houseNumber": "string",
        "id": "string",
        "latitude": 0.1,
        "longitude": 0.1,
        "postalCode": "string",
        "street": "string"
      },
      "coordinate": {
        "latitude": -90,
        "longitude": -180
      },
      "name": "string"
    },
    "locationHistory": [
      {
        "date": "2019-08-24T14:15:22Z",
        "id": "string",
        "location": {
          "address": {
            "city": "string",
            "country": "string",
            "houseNumber": "string",
            "id": "string",
            "latitude": 0.1,
            "longitude": 0.1,
            "postalCode": "string",
            "street": "string"
          },
          "coordinate": {
            "latitude": -90,
            "longitude": -180
          },
          "name": "string"
        }
      }
    ],
    "mileage": 0,
    "mileageUnit": "KM",
    "model": "string",
    "tenantId": "string",
    "type": "CAR",
    "updated": "2019-08-24T14:15:22Z",
    "updatedBy": "string",
    "vin": "string",
    "year": 0
  }
]
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Find by id in current tenant

GET
/vehicles/find/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Response Body

application/json

application/json

application/json

application/json

curl -X GET "http://localhost:18080/api/v1/vehicles/find/string"
{
  "averageFuelConsumption": 0.1,
  "brand": "string",
  "capacity": {
    "height": 0.1,
    "length": 0.1,
    "seats": 0,
    "weight": 0.1,
    "width": 0.1
  },
  "color": "string",
  "costOverDistanceDriven": 0.1,
  "created": "2019-08-24T14:15:22Z",
  "createdBy": "string",
  "currencyUnit": "string",
  "fuelHistory": [
    {
      "amount": 0.1,
      "date": "2019-08-24T14:15:22Z",
      "fuelConsumption": 0.1,
      "id": "string",
      "mileage": 0.1,
      "price": 0.1,
      "user": "string"
    }
  ],
  "fuelType": "PETROL",
  "id": "string",
  "licensePlate": "string",
  "location": {
    "address": {
      "city": "string",
      "country": "string",
      "houseNumber": "string",
      "id": "string",
      "latitude": 0.1,
      "longitude": 0.1,
      "postalCode": "string",
      "street": "string"
    },
    "coordinate": {
      "latitude": -90,
      "longitude": -180
    },
    "name": "string"
  },
  "locationHistory": [
    {
      "date": "2019-08-24T14:15:22Z",
      "id": "string",
      "location": {
        "address": {
          "city": "string",
          "country": "string",
          "houseNumber": "string",
          "id": "string",
          "latitude": 0.1,
          "longitude": 0.1,
          "postalCode": "string",
          "street": "string"
        },
        "coordinate": {
          "latitude": -90,
          "longitude": -180
        },
        "name": "string"
      }
    }
  ],
  "mileage": 0,
  "mileageUnit": "KM",
  "model": "string",
  "tenantId": "string",
  "type": "CAR",
  "updated": "2019-08-24T14:15:22Z",
  "updatedBy": "string",
  "vin": "string",
  "year": 0
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Get page by page number and size with optional sorting based on field to sortBy and direction

GET
/vehicles/page
AuthorizationBearer <token>

In: header

Query Parameters

pageNumber?integer
Formatint32
pageSize?integer
Formatint32
sortBy?string
direction?string
Value in"ASC" | "DESC"
search?string

Response Body

application/json

application/json

application/json

application/json

curl -X GET "http://localhost:18080/api/v1/vehicles/page"
{
  "content": [
    {
      "averageFuelConsumption": 0.1,
      "brand": "string",
      "capacity": {
        "height": 0.1,
        "length": 0.1,
        "seats": 0,
        "weight": 0.1,
        "width": 0.1
      },
      "color": "string",
      "costOverDistanceDriven": 0.1,
      "created": "2019-08-24T14:15:22Z",
      "createdBy": "string",
      "currencyUnit": "string",
      "fuelHistory": [
        {
          "amount": 0.1,
          "date": "2019-08-24T14:15:22Z",
          "fuelConsumption": 0.1,
          "id": "string",
          "mileage": 0.1,
          "price": 0.1,
          "user": "string"
        }
      ],
      "fuelType": "PETROL",
      "id": "string",
      "licensePlate": "string",
      "location": {
        "address": {
          "city": "string",
          "country": "string",
          "houseNumber": "string",
          "id": "string",
          "latitude": 0.1,
          "longitude": 0.1,
          "postalCode": "string",
          "street": "string"
        },
        "coordinate": {
          "latitude": -90,
          "longitude": -180
        },
        "name": "string"
      },
      "locationHistory": [
        {
          "date": "2019-08-24T14:15:22Z",
          "id": "string",
          "location": {
            "address": {
              "city": "string",
              "country": "string",
              "houseNumber": "string",
              "id": "string",
              "latitude": 0.1,
              "longitude": 0.1,
              "postalCode": "string",
              "street": "string"
            },
            "coordinate": {
              "latitude": -90,
              "longitude": -180
            },
            "name": "string"
          }
        }
      ],
      "mileage": 0,
      "mileageUnit": "KM",
      "model": "string",
      "tenantId": "string",
      "type": "CAR",
      "updated": "2019-08-24T14:15:22Z",
      "updatedBy": "string",
      "vin": "string",
      "year": 0
    }
  ],
  "empty": true,
  "first": true,
  "last": true,
  "number": 0,
  "numberOfElements": 0,
  "pageable": {
    "offset": 0,
    "pageNumber": 0,
    "pageSize": 0,
    "paged": true,
    "sort": {
      "empty": true,
      "sorted": true,
      "unsorted": true
    },
    "unpaged": true
  },
  "size": 0,
  "sort": {
    "empty": true,
    "sorted": true,
    "unsorted": true
  },
  "totalElements": 0,
  "totalPages": 0
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Delete by id in current tenant

DELETE
/vehicles/{id}
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Response Body

application/json

application/json

application/json

curl -X DELETE "http://localhost:18080/api/v1/vehicles/string"
Empty
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Update vehicle

PUT
/vehicles/{vehicleId}
AuthorizationBearer <token>

In: header

Path Parameters

vehicleId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X PUT "http://localhost:18080/api/v1/vehicles/string" \  -H "Content-Type: application/json" \  -d '{    "brand": "string",    "color": "string",    "fuelType": "PETROL",    "licensePlate": "string",    "mileage": 0,    "mileageUnit": "KM",    "model": "string",    "type": "CAR",    "year": 0  }'
{
  "averageFuelConsumption": 0.1,
  "brand": "string",
  "capacity": {
    "height": 0.1,
    "length": 0.1,
    "seats": 0,
    "weight": 0.1,
    "width": 0.1
  },
  "color": "string",
  "costOverDistanceDriven": 0.1,
  "created": "2019-08-24T14:15:22Z",
  "createdBy": "string",
  "currencyUnit": "string",
  "fuelHistory": [
    {
      "amount": 0.1,
      "date": "2019-08-24T14:15:22Z",
      "fuelConsumption": 0.1,
      "id": "string",
      "mileage": 0.1,
      "price": 0.1,
      "user": "string"
    }
  ],
  "fuelType": "PETROL",
  "id": "string",
  "licensePlate": "string",
  "location": {
    "address": {
      "city": "string",
      "country": "string",
      "houseNumber": "string",
      "id": "string",
      "latitude": 0.1,
      "longitude": 0.1,
      "postalCode": "string",
      "street": "string"
    },
    "coordinate": {
      "latitude": -90,
      "longitude": -180
    },
    "name": "string"
  },
  "locationHistory": [
    {
      "date": "2019-08-24T14:15:22Z",
      "id": "string",
      "location": {
        "address": {
          "city": "string",
          "country": "string",
          "houseNumber": "string",
          "id": "string",
          "latitude": 0.1,
          "longitude": 0.1,
          "postalCode": "string",
          "street": "string"
        },
        "coordinate": {
          "latitude": -90,
          "longitude": -180
        },
        "name": "string"
      }
    }
  ],
  "mileage": 0,
  "mileageUnit": "KM",
  "model": "string",
  "tenantId": "string",
  "type": "CAR",
  "updated": "2019-08-24T14:15:22Z",
  "updatedBy": "string",
  "vin": "string",
  "year": 0
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}

Add refueling to vehicle

POST
/vehicles/{vehicleId}/refueling
AuthorizationBearer <token>

In: header

Path Parameters

vehicleId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:18080/api/v1/vehicles/string/refueling" \  -H "Content-Type: application/json" \  -d '{    "amount": 0.1,    "date": "2019-08-24T14:15:22Z",    "mileage": 0.1,    "price": 0.1  }'
{
  "averageFuelConsumption": 0.1,
  "brand": "string",
  "capacity": {
    "height": 0.1,
    "length": 0.1,
    "seats": 0,
    "weight": 0.1,
    "width": 0.1
  },
  "color": "string",
  "costOverDistanceDriven": 0.1,
  "created": "2019-08-24T14:15:22Z",
  "createdBy": "string",
  "currencyUnit": "string",
  "fuelHistory": [
    {
      "amount": 0.1,
      "date": "2019-08-24T14:15:22Z",
      "fuelConsumption": 0.1,
      "id": "string",
      "mileage": 0.1,
      "price": 0.1,
      "user": "string"
    }
  ],
  "fuelType": "PETROL",
  "id": "string",
  "licensePlate": "string",
  "location": {
    "address": {
      "city": "string",
      "country": "string",
      "houseNumber": "string",
      "id": "string",
      "latitude": 0.1,
      "longitude": 0.1,
      "postalCode": "string",
      "street": "string"
    },
    "coordinate": {
      "latitude": -90,
      "longitude": -180
    },
    "name": "string"
  },
  "locationHistory": [
    {
      "date": "2019-08-24T14:15:22Z",
      "id": "string",
      "location": {
        "address": {
          "city": "string",
          "country": "string",
          "houseNumber": "string",
          "id": "string",
          "latitude": 0.1,
          "longitude": 0.1,
          "postalCode": "string",
          "street": "string"
        },
        "coordinate": {
          "latitude": -90,
          "longitude": -180
        },
        "name": "string"
      }
    }
  ],
  "mileage": 0,
  "mileageUnit": "KM",
  "model": "string",
  "tenantId": "string",
  "type": "CAR",
  "updated": "2019-08-24T14:15:22Z",
  "updatedBy": "string",
  "vin": "string",
  "year": 0
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}
{
  "detail": "string",
  "time": "2019-08-24T14:15:22Z",
  "title": "string"
}