Add Costs
Curl request
$ curl 'https://logbook.stainhaufen.de/api/car/de1fc099-81c9-43cf-8efb-51d968af02e5/additionalcosts' -i -X POST \
-H 'Content-Type: application/json' \
-d '{
"type" : "OTHER",
"costs" : 40.0,
"mileage" : 153000
}'
Request fields
| Path | Type | Description |
|---|---|---|
|
|
Type of costs, available types are listed ininternal controller |
|
|
Costs of new entry |
|
|
Current mileage at time of costs, could be null |
HTTP response
HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Location: /car/de1fc099-81c9-43cf-8efb-51d968af02e5/costs/6f8f4580-8e5c-4b20-b16c-f3232badad1f
Get one Car
Curl request
$ curl 'https://logbook.stainhaufen.de/api/car/de1fc099-81c9-43cf-8efb-51d968af02e5/additionalcosts/d0f4ba2a-c3a6-4f0a-9796-979d40740068' -i -X GET
Path parameters
| Parameter | Description |
|---|---|
|
id of car to get costs for |
|
id of cost to 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: 114
{
"id" : "d0f4ba2a-c3a6-4f0a-9796-979d40740068",
"type" : "OTHER",
"costs" : 15.0,
"mileage" : null
}
Response body
{
"id" : "d0f4ba2a-c3a6-4f0a-9796-979d40740068",
"type" : "OTHER",
"costs" : 15.0,
"mileage" : null
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
Id of costs |
|
|
Type of costs |
|
|
Costs |
|
|
Mileage at time of costs |
Get all Cars
Curl request
$ curl 'https://logbook.stainhaufen.de/api/car/de1fc099-81c9-43cf-8efb-51d968af02e5/additionalcosts' -i -X GET
Path parameters
| Parameter | Description |
|---|---|
|
id of car to get costs for |
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: 118
[ {
"id" : "c12ef298-a115-4d98-8082-966a38eb5184",
"type" : "OTHER",
"costs" : 15.0,
"mileage" : null
} ]
Response body
[ {
"id" : "c12ef298-a115-4d98-8082-966a38eb5184",
"type" : "OTHER",
"costs" : 15.0,
"mileage" : null
} ]
Response fields
| Path | Type | Description |
|---|---|---|
|
|
Array of costs for given car |
|
|
Id of costs |
|
|
Type of costs |
|
|
Costs |
|
|
Mileage at time of costs |
Update Car
Curl request
$ curl 'https://logbook.stainhaufen.de/api/car/de1fc099-81c9-43cf-8efb-51d968af02e5/additionalcosts/2edfc3ed-5fd1-470b-b5b3-d200ea26e3b2' -i -X POST \
-H 'Content-Type: application/json' \
-d '{
"type" : "REPAIR",
"costs" : 20.0,
"mileage" : 200000
}'
Path parameters
| Parameter | Description |
|---|---|
|
id of car to get costs for |
|
id of cost to get |
Request body
{
"type" : "REPAIR",
"costs" : 20.0,
"mileage" : 200000
}
Request fields
| Path | Type | Description |
|---|---|---|
|
|
Type of costs, available types are listed ininternal controller |
|
|
Costs of new entry |
|
|
Current mileage at time of costs, could be null |
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: 117
{
"id" : "2edfc3ed-5fd1-470b-b5b3-d200ea26e3b2",
"type" : "REPAIR",
"costs" : 20.0,
"mileage" : 200000
}
Response body
{
"id" : "2edfc3ed-5fd1-470b-b5b3-d200ea26e3b2",
"type" : "REPAIR",
"costs" : 20.0,
"mileage" : 200000
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
Id of costs |
|
|
Type of costs |
|
|
Costs |
|
|
Mileage at time of costs |
Delete Car
Curl request
$ curl 'https://logbook.stainhaufen.de/api/car/de1fc099-81c9-43cf-8efb-51d968af02e5/additionalcosts/4d3ad3ef-6ab1-45f9-9410-aefd9faaf88e' -i -X DELETE
Path parameters
| Parameter | Description |
|---|---|
|
id of car to get costs for |
|
id of cost to get |
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers