Create new Car

Curl request

$ curl 'https://logbook.stainhaufen.de/api/car' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "kennzeichen" : "LEO-MS 1235",
  "kilometer" : 132125,
  "name" : "audo"
}'

Request fields

Path Type Description

kennzeichen

String

License plate

kilometer

Number

total kilometers

name

String

personal name of car

HTTP response

HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Location: /car/4432fc47-395a-4033-b167-00e37a7785a0

Get one Car

Curl request

$ curl 'https://logbook.stainhaufen.de/api/car/de1fc099-81c9-43cf-8efb-51d968af02e5' -i -X GET

Path parameters

Table 1. /api/car/{carId}
Parameter Description

carId

ID of the car you want to get information about

HTTP response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 931

{
  "id" : "de1fc099-81c9-43cf-8efb-51d968af02e5",
  "kennzeichen" : "LEO-MS 1234",
  "kilometer" : 123123,
  "name" : "",
  "routes" : [ {
    "id" : "e53eb99b-9ce1-4c41-bd59-fa503c8bded9",
    "startMileage" : 123123,
    "endMileage" : null,
    "destination" : null,
    "reason" : null
  } ],
  "fuelUps" : [ {
    "id" : "cdc4125c-d7b6-499c-ae38-66cab9f82017",
    "liter" : 50,
    "mileage" : 200000,
    "costs" : 70.0,
    "filledUp" : true
  } ],
  "additionalCosts" : [ {
    "id" : "539d051f-d812-4ebd-bb31-72536275cfbf",
    "type" : "OTHER",
    "costs" : 20.0,
    "mileage" : null
  } ],
  "users" : [ {
    "id" : "b07620cc-c258-4e12-8ce7-7b77d992f35f",
    "providers" : [ {
      "provider" : "local",
      "profileUri" : "local/profile/id"
    } ],
    "email" : "test@test.test",
    "nickname" : "test",
    "name" : "Test Test",
    "pictureUri" : "picture/test"
  } ]
}

Response body

{
  "id" : "de1fc099-81c9-43cf-8efb-51d968af02e5",
  "kennzeichen" : "LEO-MS 1234",
  "kilometer" : 123123,
  "name" : "",
  "routes" : [ {
    "id" : "e53eb99b-9ce1-4c41-bd59-fa503c8bded9",
    "startMileage" : 123123,
    "endMileage" : null,
    "destination" : null,
    "reason" : null
  } ],
  "fuelUps" : [ {
    "id" : "cdc4125c-d7b6-499c-ae38-66cab9f82017",
    "liter" : 50,
    "mileage" : 200000,
    "costs" : 70.0,
    "filledUp" : true
  } ],
  "additionalCosts" : [ {
    "id" : "539d051f-d812-4ebd-bb31-72536275cfbf",
    "type" : "OTHER",
    "costs" : 20.0,
    "mileage" : null
  } ],
  "users" : [ {
    "id" : "b07620cc-c258-4e12-8ce7-7b77d992f35f",
    "providers" : [ {
      "provider" : "local",
      "profileUri" : "local/profile/id"
    } ],
    "email" : "test@test.test",
    "nickname" : "test",
    "name" : "Test Test",
    "pictureUri" : "picture/test"
  } ]
}

Response fields

Path Type Description

id

UUID

id of the car

kennzeichen

String

License plate

kilometer

Number

total kilometers

name

String

name of the car

routes

Array

List of driven routes

fuelUps

Array

List of gas ups

additionalCosts

Array

List of additional Costs

users[]

Array

Users of this car

users[].id

UUID

Internal id of user

users[].email

String

Email of user

users[].nickname

String

Nickname of user

users[].name

String

Full Name of user

users[].pictureUri

String

Uri of picture to use

users[].providers[]

Array

Array of providers where user is authenticated

users[].providers[].provider

String

Id of the provider

users[].providers[].profileUri

String

Uri of the user for provider

routes[]

Array

Routes driven with this car

routes[].id

UUID

id of route

routes[].startMileage

Number

Mileage at start

routes[].endMileage

Number

Mileage at end

routes[].destination

String

Destination of route

routes[].reason

String

Reason of route

fuelUps[]

Array

Fuelm Ups for car

fuelUps[].id

UUID

ID of fuel up entry

fuelUps[].liter

Number

Liters fueled in

fuelUps[].mileage

Number

Overall kilometers aat time fueled up

fuelUps[].costs

Number

Costs to fuel up

fuelUps[].filledUp

Number

Filled up to full tank?

additionalCosts[]

Array

Array of costs for car

additionalCosts[].id

UUID

Id of costs

additionalCosts[].type

String

Type of costs

additionalCosts[].costs

Number

Costs

additionalCosts[].mileage

Number

Mileage at time of costs

Get all Cars

Curl request

$ curl 'https://logbook.stainhaufen.de/api/car' -i -X GET

HTTP response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 998

[ {
  "id" : "de1fc099-81c9-43cf-8efb-51d968af02e5",
  "kennzeichen" : "LEO-MS 1234",
  "kilometer" : 123123,
  "name" : "",
  "routes" : [ ],
  "fuelUps" : [ ],
  "additionalCosts" : [ ],
  "users" : [ {
    "id" : "b07620cc-c258-4e12-8ce7-7b77d992f35f",
    "providers" : [ {
      "provider" : "local",
      "profileUri" : "local/profile/id"
    } ],
    "email" : "test@test.test",
    "nickname" : "test",
    "name" : "Test Test",
    "pictureUri" : "picture/test"
  } ]
}, {
  "id" : "4432fc47-395a-4033-b167-00e37a7785a0",
  "kennzeichen" : "LEO-MS 1235",
  "kilometer" : 132125,
  "name" : "",
  "routes" : [ ],
  "fuelUps" : [ ],
  "additionalCosts" : [ ],
  "users" : [ {
    "id" : "b07620cc-c258-4e12-8ce7-7b77d992f35f",
    "providers" : [ {
      "provider" : "local",
      "profileUri" : "local/profile/id"
    } ],
    "email" : "test@test.test",
    "nickname" : "test",
    "name" : "Test Test",
    "pictureUri" : "picture/test"
  } ]
} ]

Response body

[ {
  "id" : "de1fc099-81c9-43cf-8efb-51d968af02e5",
  "kennzeichen" : "LEO-MS 1234",
  "kilometer" : 123123,
  "name" : "",
  "routes" : [ ],
  "fuelUps" : [ ],
  "additionalCosts" : [ ],
  "users" : [ {
    "id" : "b07620cc-c258-4e12-8ce7-7b77d992f35f",
    "providers" : [ {
      "provider" : "local",
      "profileUri" : "local/profile/id"
    } ],
    "email" : "test@test.test",
    "nickname" : "test",
    "name" : "Test Test",
    "pictureUri" : "picture/test"
  } ]
}, {
  "id" : "4432fc47-395a-4033-b167-00e37a7785a0",
  "kennzeichen" : "LEO-MS 1235",
  "kilometer" : 132125,
  "name" : "",
  "routes" : [ ],
  "fuelUps" : [ ],
  "additionalCosts" : [ ],
  "users" : [ {
    "id" : "b07620cc-c258-4e12-8ce7-7b77d992f35f",
    "providers" : [ {
      "provider" : "local",
      "profileUri" : "local/profile/id"
    } ],
    "email" : "test@test.test",
    "nickname" : "test",
    "name" : "Test Test",
    "pictureUri" : "picture/test"
  } ]
} ]

Response fields

Path Type Description

[].id

UUID

id of the car

[].kennzeichen

String

License plate

[].kilometer

Number

total kilometers

[].name

String

name of the car

[].routes

Array

List of driven routes

[].fuelUps

Array

List of gas ups

[].additionalCosts

Array

List of additional Costs

[].users[]

Array

Users of this car

[].users[].id

UUID

Internal id of user

[].users[].email

String

Email of user

[].users[].nickname

String

Nickname of user

[].users[].name

String

Full Name of user

[].users[].pictureUri

String

Uri of picture to use

[].users[].providers[]

Array

Array of providers where user is authenticated

[].users[].providers[].provider

String

Id of the provider

[].users[].providers[].profileUri

String

Uri of the user for provider

[].routes[]

Array

Routes driven with this car

[].routes[].id

UUID

id of route

[].routes[].startMileage

Number

Mileage at start

[].routes[].endMileage

Number

Mileage at end

[].routes[].destination

String

Destination of route

[].routes[].reason

String

Reason of route

[].fuelUps[]

Array

Fuelm Ups for car

[].fuelUps[].id

UUID

ID of fuel up entry

[].fuelUps[].liter

Number

Liters fueled in

[].fuelUps[].mileage

Number

Overall kilometers aat time fueled up

[].fuelUps[].costs

Number

Costs to fuel up

[].fuelUps[].filledUp

Number

Filled up to full tank?

[].additionalCosts[]

Array

Array of costs for car

[].additionalCosts[].id

UUID

Id of costs

[].additionalCosts[].type

String

Type of costs

[].additionalCosts[].costs

Number

Costs

[].additionalCosts[].mileage

Number

Mileage at time of costs

Update Car

Curl request

$ curl 'https://logbook.stainhaufen.de/api/car/de1fc099-81c9-43cf-8efb-51d968af02e5' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "kennzeichen" : "LEO-MS 1234",
  "kilometer" : 123125,
  "name" : "Auddole"
}'

Path parameters

Table 1. /api/car/{carId}
Parameter Description

carId

Id of car to update

Request body

{
  "kennzeichen" : "LEO-MS 1234",
  "kilometer" : 123125,
  "name" : "Auddole"
}

Request fields

Path Type Description

kennzeichen

String

License plate

kilometer

Number

total kilometers

name

String

personal name of car

HTTP response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 496

{
  "id" : "de1fc099-81c9-43cf-8efb-51d968af02e5",
  "kennzeichen" : "LEO-MS 1234",
  "kilometer" : 123125,
  "name" : "",
  "routes" : [ ],
  "fuelUps" : [ ],
  "additionalCosts" : [ ],
  "users" : [ {
    "id" : "b07620cc-c258-4e12-8ce7-7b77d992f35f",
    "providers" : [ {
      "provider" : "local",
      "profileUri" : "local/profile/id"
    } ],
    "email" : "test@test.test",
    "nickname" : "test",
    "name" : "Test Test",
    "pictureUri" : "picture/test"
  } ]
}

Response body

{
  "id" : "de1fc099-81c9-43cf-8efb-51d968af02e5",
  "kennzeichen" : "LEO-MS 1234",
  "kilometer" : 123125,
  "name" : "",
  "routes" : [ ],
  "fuelUps" : [ ],
  "additionalCosts" : [ ],
  "users" : [ {
    "id" : "b07620cc-c258-4e12-8ce7-7b77d992f35f",
    "providers" : [ {
      "provider" : "local",
      "profileUri" : "local/profile/id"
    } ],
    "email" : "test@test.test",
    "nickname" : "test",
    "name" : "Test Test",
    "pictureUri" : "picture/test"
  } ]
}

Response fields

Path Type Description

id

UUID

id of the car

kennzeichen

String

License plate

kilometer

Number

total kilometers

name

String

name of the car

routes

Array

List of driven routes

fuelUps

Array

List of gas ups

additionalCosts

Array

List of additional Costs

users[]

Array

Users of this car

users[].id

UUID

Internal id of user

users[].email

String

Email of user

users[].nickname

String

Nickname of user

users[].name

String

Full Name of user

users[].pictureUri

String

Uri of picture to use

users[].providers[]

Array

Array of providers where user is authenticated

users[].providers[].provider

String

Id of the provider

users[].providers[].profileUri

String

Uri of the user for provider

routes[]

Array

Routes driven with this car

routes[].id

UUID

id of route

routes[].startMileage

Number

Mileage at start

routes[].endMileage

Number

Mileage at end

routes[].destination

String

Destination of route

routes[].reason

String

Reason of route

fuelUps[]

Array

Fuelm Ups for car

fuelUps[].id

UUID

ID of fuel up entry

fuelUps[].liter

Number

Liters fueled in

fuelUps[].mileage

Number

Overall kilometers aat time fueled up

fuelUps[].costs

Number

Costs to fuel up

fuelUps[].filledUp

Number

Filled up to full tank?

additionalCosts[]

Array

Array of costs for car

additionalCosts[].id

UUID

Id of costs

additionalCosts[].type

String

Type of costs

additionalCosts[].costs

Number

Costs

additionalCosts[].mileage

Number

Mileage at time of costs

Delete Car

Curl request

$ curl 'https://logbook.stainhaufen.de/api/car/de1fc099-81c9-43cf-8efb-51d968af02e5' -i -X DELETE

Path parameters

Table 1. /api/car/{carId}
Parameter Description

carId

Id of car to delete

HTTP response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers