GET/api/v1/time-entries
Elencare le registrazioni delle ore
Registrazioni nel periodo da from a to, facoltativamente per un solo collaboratore.
Scope richiesto: time_entries:read.
Scope: time_entries:read
Parametri| Campo | Tipo | Obbligatorio | Note |
|---|
| from(query) | string | sì | Pattern ^\d{4}-\d{2}-\d{2}$ |
| to(query) | string | sì | Pattern ^\d{4}-\d{2}-\d{2}$ |
| user_id(query) | string (uuid) | no | |
| limit(query) | integer | no | I valori oltre 500 vengono ridotti a 500. · Predefinito: 200 · min. 1 · max. 500 |
| offset(query) | integer | no | Predefinito: 0 · min. 0 |
Risposte
- 200 Registrazioni delle ore.
- 400 Input non valido.
- 401 Chiave API mancante, sconosciuta o revocata. Corpo vuoto.
- 403 Alla chiave manca lo scope richiesto.
- 429 Troppe richieste per questa chiave.
- 500 Errore interno.
Risposta 200| Campo | Tipo | Obbligatorio | Note |
|---|
| entries | object[] | sì | |
| entries[].id | string (uuid) | sì | |
| entries[].user_id | string (uuid) | null | sì | |
| entries[].project_id | string (uuid) | sì | |
| entries[].date | string | sì | |
| entries[].start_time | string | null | sì | |
| entries[].end_time | string | null | sì | |
| entries[].break_minutes | integer | sì | |
| entries[].duration_minutes | integer | sì | |
| entries[].work_type | "arbeiten" | "laden" | "fahren" | "pause" | sì | |
| entries[].description | string | null | sì | |
| entries[].is_billable | boolean | null | sì | |
| entries[].status | "pending" | "approved" | "rejected" | "invoiced" | sì | |
| entries[].external_source | string | null | sì | |
| entries[].external_id | string | null | sì | |
| entries[].project | object | null | sì | |
| entries[].project.id | string (uuid) | sì | |
| entries[].project.name | string | sì | |
| has_more | boolean | sì | |
POST/api/v1/time-entries
Trasferire una registrazione delle ore
O duration_minutes oppure start_time e end_time. Con external_source e external_id una nuova chiamata aggiorna la stessa registrazione invece di crearne una seconda. L'approvazione la stabilisce l'impresa.
Scope richiesto: time_entries:write.
Scope: time_entries:write
Corpo della richiesta (JSON)| Campo | Tipo | Obbligatorio | Note |
|---|
| user_id | string (uuid) | sì | |
| project_id | string (uuid) | sì | |
| date | string | sì | Pattern ^\d{4}-\d{2}-\d{2}$ |
| work_type | "arbeiten" | "laden" | "fahren" | "pause" | no | Predefinito: "arbeiten" |
| start_time | string | no | Pattern ^\d{1,2}:\d{2}$ |
| end_time | string | no | Pattern ^\d{1,2}:\d{2}$ |
| break_minutes | number | no | min. 0 |
| duration_minutes | number | no | min. 0 · max. 1440 |
| description | string | no | |
| is_billable | boolean | no | |
| external_source | string | no | |
| external_id | string | no | |
Risposte
- 200 Registrazione esistente della stessa origine aggiornata.
- 201 Registrazione creata (`created`); con origine nota 200 con `updated`.
- 400 Input non valido.
- 401 Chiave API mancante, sconosciuta o revocata. Corpo vuoto.
- 403 Alla chiave manca lo scope richiesto.
- 404 Non trovato – anche per ID di un'altra impresa.
- 409 Conflitto, ad es. numero cliente o di progetto duplicato oppure registrazione delle ore già fatturata.
- 429 Troppe richieste per questa chiave.
- 500 Errore interno.
Risposta 200| Campo | Tipo | Obbligatorio | Note |
|---|
| action | "created" | "updated" | sì | |
| id | string (uuid) | sì | |
Risposta 201| Campo | Tipo | Obbligatorio | Note |
|---|
| action | "created" | "updated" | sì | |
| id | string (uuid) | sì | |