Vatrogasci
Upravljajte zapisima vatrogasaca — pregledajte, kreirajte, ažurirajte i brišite osoblje u vašem odjelu.
Pregled #
API za vatrogasce pruža potpune CRUD operacije za upravljanje zapisima osoblja. Svi endpointi su ograničeni na vašeg zakupca — možete pristupiti samo vatrogascima koji pripadaju vašem odjelu.
Referenca polja #
| Name | Type | Description | |
|---|---|---|---|
| id | uuid | Optional | Jedinstveni identifikator |
| firstName | string | Required | Ime (1-100 znakova) |
| lastName | string | Required | Prezime (1-100 znakova) |
| phoneNumber | string | Optional | Telefonski broj (do 50 znakova) |
| string | Optional | Email adresa | |
| dateOfBirth | datetime | Optional | Datum rođenja (ISO 8601) |
| invitationStatus | string | Optional | Status pozivnice na platformu |
| userId | uuid | Optional | ID povezanog korisničkog računa |
Popis vatrogasaca #
Vraća paginirani popis vatrogasaca. Podržava pretraživanje, sortiranje i paginaciju.
GET /api/v1/firefighters
Parametri upita
| Name | Type | Description | |
|---|---|---|---|
| page | integer | Optional | Broj stranice (zadano: 1) |
| pageSize | integer | Optional | Stavki po stranici (zadano: 20, maks: 100) |
| search | string | Optional | Pretraživanje po imenu, emailu ili telefonu |
| sortBy | string | Optional | Polje sortiranja (npr. firstName, lastName) |
| sortDir | string | Optional | Smjer sortiranja: asc ili desc (zadano: desc) |
bash Request
curl -X GET "https://app.firecustos.com/api/v1/firefighters?page=1&pageSize=10&search=Ivan" \
-H "Authorization: Bearer fc_your_api_key_here" 200 OK
json Response
{
"data": {
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"firstName": "Ivan",
"lastName": "Horvat",
"phoneNumber": "+385 91 234 5678",
"email": "[email protected]",
"dateOfBirth": "1990-05-15T00:00:00Z",
"invitationStatus": null,
"userId": null
}
],
"page": 1,
"pageSize": 10,
"totalCount": 1,
"totalPages": 1,
"hasPreviousPage": false,
"hasNextPage": false
},
"totalCount": 1
} Dohvati vatrogasca #
Vraća jednog vatrogasca po ID-u.
GET /api/v1/firefighters/{id}
Parametri putanje
| Name | Type | Description | |
|---|---|---|---|
| id | uuid | Required | UUID vatrogasca |
bash Request
curl -X GET https://app.firecustos.com/api/v1/firefighters/3fa85f64-5717-4562-b3fc-2c963f66afa6 \
-H "Authorization: Bearer fc_your_api_key_here" 200 OK
json Response
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"firstName": "Ivan",
"lastName": "Horvat",
"phoneNumber": "+385 91 234 5678",
"email": "[email protected]",
"dateOfBirth": "1990-05-15T00:00:00Z",
"invitationStatus": null,
"userId": null
} Kreiraj vatrogasca #
Kreira novi zapis vatrogasca.
POST /api/v1/firefighters
Tijelo zahtjeva
| Name | Type | Description | |
|---|---|---|---|
| firstName | string | Required | Ime (1-100 znakova) |
| lastName | string | Required | Prezime (1-100 znakova) |
| phoneNumber | string | Optional | Telefonski broj (do 50 znakova) |
| string | Optional | Email adresa | |
| dateOfBirth | datetime | Optional | Datum rođenja (ISO 8601) |
bash Request
curl -X POST https://app.firecustos.com/api/v1/firefighters \
-H "Authorization: Bearer fc_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"firstName":"Marko","lastName":"Perić","phoneNumber":"+385 98 765 4321","email":"[email protected]","dateOfBirth":"1985-03-22T00:00:00Z"}' 201 Created
json Response
{
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"firstName": "Marko",
"lastName": "Perić",
"phoneNumber": "+385 98 765 4321",
"email": "[email protected]",
"dateOfBirth": "1985-03-22T00:00:00Z",
"invitationStatus": null,
"userId": null
} Ažuriraj vatrogasca #
Ažurira postojeći zapis vatrogasca. Sva polja u tijelu zahtjeva su obavezna — ovo je potpuna zamjena.
PUT /api/v1/firefighters/{id}
Parametri putanje
| Name | Type | Description | |
|---|---|---|---|
| id | uuid | Required | UUID vatrogasca |
Tijelo zahtjeva
| Name | Type | Description | |
|---|---|---|---|
| firstName | string | Required | Ime (1-100 znakova) |
| lastName | string | Required | Prezime (1-100 znakova) |
| phoneNumber | string | Optional | Telefonski broj (do 50 znakova) |
| string | Optional | Email adresa | |
| dateOfBirth | datetime | Optional | Datum rođenja (ISO 8601) |
bash Request
curl -X PUT https://app.firecustos.com/api/v1/firefighters/7c9e6679-7425-40de-944b-e07fc1f90ae7 \
-H "Authorization: Bearer fc_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"firstName":"Marko","lastName":"Perić","phoneNumber":"+385 98 765 0000","email":"[email protected]","dateOfBirth":"1985-03-22T00:00:00Z"}' 200 OK
json Response
{
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"firstName": "Marko",
"lastName": "Perić",
"phoneNumber": "+385 98 765 0000",
"email": "[email protected]",
"dateOfBirth": "1985-03-22T00:00:00Z",
"invitationStatus": null,
"userId": null
} Obriši vatrogasca #
Briše zapis vatrogasca (meko brisanje).
DELETE /api/v1/firefighters/{id}
Parametri putanje
| Name | Type | Description | |
|---|---|---|---|
| id | uuid | Required | UUID vatrogasca |
bash Request
curl -X DELETE https://app.firecustos.com/api/v1/firefighters/7c9e6679-7425-40de-944b-e07fc1f90ae7 \
-H "Authorization: Bearer fc_your_api_key_here" 204 No Content
On success, the API returns an empty response with status 204.