POST
/api/v1/houses/{houseId}/log
operationId addLogEntry
- Bearer-token
- Kräver redigeringsrätt i huset
- Skrivtaket gäller
- Tar Idempotency-Key
Parametrar
| Namn | Var | Typ | Krävs |
houseId |
adressen |
integer |
ja |
Kropp application/json · AddLogBody
| Fält | Typ | Krävs |
date |
datum |
nej |
what |
string |
nej |
component |
string |
nej |
kind |
string |
nej |
costKr |
integer |
nej |
isImprovement |
boolean |
ja |
contractor |
string |
nej |
phone |
string |
nej |
warrantyUntil |
datum |
nej |
buildingPart |
string |
nej |
craftsmanId |
integer |
nej |
{
"date": "2026-11-13",
"what": "text",
"component": "text",
"kind": "text",
"costKr": 1,
"isImprovement": false,
"contractor": "text",
"phone": "text",
"warrantyUntil": "2026-11-13",
"buildingPart": "text",
"craftsmanId": 1
}
Exempel
curl -X POST "https://husvo.app/api/v1/houses/1/log" \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"date":"2026-11-13","what":"text","component":"text","kind":"text","costKr":1,"isImprovement":false,"contractor":"text","phone":"text","warrantyUntil":"2026-11-13","buildingPart":"text","craftsmanId":1}'
Svar
201 Skapad · LogEntryDto
{
"id": 1,
"date": "2026-11-13",
"what": "text",
"component": "text",
"kind": "text",
"costKr": 1,
"isImprovement": false,
"contractor": "text",
"phone": "text",
"warrantyUntil": "2026-11-13",
"buildingPart": "text",
"authorName": "text",
"hasReceipt": false,
"receiptPhotoId": 1,
"craftsmanId": 1,
"craftsmanName": "text"
}
Fel, som problem+json (felkoderna):
- 403Inte tillåtet
- 404Finns inte, eller inte för dig
- 422Kontrollera uppgifterna
PATCH
/api/v1/houses/{houseId}/log/{logId}
operationId updateLogEntry
- Bearer-token
- Kräver redigeringsrätt i huset
- Skrivtaket gäller
Parametrar
| Namn | Var | Typ | Krävs |
houseId |
adressen |
integer |
ja |
logId |
adressen |
integer |
ja |
Kropp application/json · PatchLogBody
| Fält | Typ | Krävs |
costKr |
integer |
nej |
clearCost |
boolean |
nej |
isImprovement |
boolean |
nej |
buildingPart |
string |
nej |
craftsmanId |
integer |
nej |
clearCraftsman |
boolean |
nej |
{
"costKr": 1,
"clearCost": false,
"isImprovement": false,
"buildingPart": "text",
"craftsmanId": 1,
"clearCraftsman": false
}
Exempel
curl -X PATCH "https://husvo.app/api/v1/houses/1/log/1" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"costKr":1,"clearCost":false,"isImprovement":false,"buildingPart":"text","craftsmanId":1,"clearCraftsman":false}'
Svar
200 Klart · LogEntryDto
{
"id": 1,
"date": "2026-11-13",
"what": "text",
"component": "text",
"kind": "text",
"costKr": 1,
"isImprovement": false,
"contractor": "text",
"phone": "text",
"warrantyUntil": "2026-11-13",
"buildingPart": "text",
"authorName": "text",
"hasReceipt": false,
"receiptPhotoId": 1,
"craftsmanId": 1,
"craftsmanName": "text"
}
Fel, som problem+json (felkoderna):
- 403Inte tillåtet
- 404Finns inte, eller inte för dig
- 422Kontrollera uppgifterna