CIT – API-dokumentation
API’et bruges til at oprette, hente, opdatere og slette hændelser.
Baseadresse: http://localhost:7070/api/v1
Endpoints
Alle URL’er nedenfor er relative til baseadressen.
| Metode | URL | Request Body (JSON) | Response (JSON) | Fejl |
|---|---|---|---|---|
| POST | /auth/register | Bruger (4) | Bekræftelse (4), status 201 | 400, 409 |
| POST | /auth/login | Login (5) | Token (5), status 200 | 401 |
| GET | /incidents | Ingen | Liste af hændelser (1), status 200 | 401 |
| GET | /incidents/{id} | Ingen | Hændelse (1), status 200 | 400, 401, 404 |
| POST | /incidents | Oprettelsesformat (2) | Hændelse (1), status 201 | 400, 401 |
| PUT | /incidents/{id} | Opdateringsformat (3) | Hændelse (1), status 200 | 400, 401, 404 |
| DELETE | /incidents/{id} | Ingen | Ingen body, status 204 | 400, 401, 403, 404 |
Login og adgang
Register og login er offentlige. Alle incident-endpoints kræver et gyldigt JWT i denne header: