Lo scopo principale dell’API Driver Time Analysis è quello di produrre i dati relativi ai tempi di lavoro e di riposo dei conducenti per uno specifico autista. I dati forniti si basano sulla funzionalità di analisi del tempo.
Esempio di richiesta API per un driver specifico:
GET /drivers/{driverId}/current-time-analysis?version=1&api_key=<...>
HOST:api.fm-track.com
Content-Type:application/json;charset=UTF-8
Affinché questa API funzioni, i seguenti parametri sono obbligatori:
Parameter | Type | Description |
---|---|---|
driverId | String | Driver identifier (This ID can be acquired by sending a request to the Drivers API) |
version | String | Version of the API, currently only version=1 is available |
api_key | String | User identification key |
Di seguito è riportato un esempio di risposta:
{ "type": "PRIMARY", "calculated_until": "2018-05-31T14:47:47.000Z", "state": { "activity": "UNKNOWN", "started_at": "2018-05-24T11:10:00.000Z", "duration": 617820 }, "current_day": { "driving_status": "SINGLE", "driving": { "regular": { "duration": 0, "duration_limit": 32400 }, "extra": { "duration": 0, "duration_limit": 3600 } }, "working": { "duration": 0 }, "resting": { "rest_in_progress": false, "next_rest": null } }, "current_week": { "driving": { "duration": 0, "duration_limit": 201600, "extended_daily_driving_periods": { "used": 0, "usage_limit": 2 } }, "working": { "duration": 0 }, "resting": { "rest_in_progress": false, "next_rest": null, "reduced_daily_rests": { "used":0, "usage_limit": 3 } } }, "previous_week": { "driving": { "duration": 0, "duration_limit": 201600 }, "resting": { "duration": 0 } }, "infringements": { "daily_driving_limit_exceeded": { "duration": 0 }, "weekly_driving_limit_exceeded": { "duration": 0 } }, "data_gap_duration": { "duration": 0 } }
Se un parametro o la chiave API_ non sono stati inseriti correttamente, il sistema risponderà con un codice di errore; tutti i possibili codici di errore sono descritti nella sezione API.
Tutti i campi di risposta che possono essere ricevuti con ogni tipo di parametro sono descritti nella tabella successiva:
Name | Type | Description | Units |
---|---|---|---|
type | String | Indicates whether the driver is primary or secondary, that is, whether the driver card is inserted into the first or second card slot in the tachograph | Text |
calculated_until | Date | Date and time when the request was made Format: "yyyy-mm-ddThh:mm:ss.sssZ" | According to ISO8601 |
state | Array | Contains all driver state parameters | |
activity | String | The driver state when the request was made | Text |
started_at | Date | Date and time when the driver entered a state Format: "yyyy-mm-ddThh:mm:ss.sssZ" | According to ISO8601 |
duration | Integer | Total time the driver was in a state | Seconds |
current_day | Array | Contains all current day parameters | |
driving_status | String | Indicates whether there is a single driver or a crew | Text |
driving | Array | Contains all driving parameters | |
regular | Array | Contains all regular driving parameters | |
duration | Integer | Total regular driving duration | Seconds |
duration_limit | Integer | The maximum allowed regular driving duration | Seconds |
extra | Array | Contains extra driving parameters | |
duration | Integer | Total extra driving duration | Seconds |
duration_limit | Integer | The maximum allowed extra driving duration | Seconds |
working | Array | Contains all daily working parameters | |
duration | Integer | Total daily working duration | Seconds |
resting | Array | Contains all daily rest parameters | |
rest_in_progress | Boolean | Indicates if the driver was resting when the request was made | True - False |
next_rest | Date | Date and time of the next daily rest Format: "yyyy-mm-ddThh:mm:ss.sssZ" | According to ISO8601 |
current_week | Array | Contains all current week parameters | |
driving | Array | Contains all driving parameters | |
duration | Integer | Total weekly driving duration | Seconds |
duration_limit | Integer | The maximum allowed weekly driving duration | Seconds |
extended_daily_driving_periods | Array | Contains all extended daily driving period parameters | |
used | Integer | The amount of used extended driving periods | Number |
usage_limit | Integer | The maximum amount of extended driving periods | Number |
working | Array | Contains all weekly working parameters | |
duration | Integer | Total weekly working duration | Seconds |
resting | Array | Contains all weekly rest parameters | |
rest_in_progress | Boolean | Indicates if the driver was resting when the request was made | True - False |
next_rest | Date | Date and time of the next weekly rest Format: "yyyy-mm-ddThh:mm:ss.sssZ" | According to ISO8601 |
reduced_daily_rests | Array | Contains all reduced daily rest parameters | |
used | Integer | The amount of used reduced daily rest periods | Number |
usage_limit | Integer | The maximum amount of reduced daily rest periods | Number |
previous_week | Array | Contains all previous week parameters | |
driving | Array | Contains all driving parameters | |
duration | Integer | Total driving duration the previous week | Seconds |
duration_limit | Integer | The maximum allowed weekly driving duration | Seconds |
resting | Array | Contains all resting parameters for the previous week | |
duration | Integer | Total resting duration the previous week | Seconds |
infringements | Array | Contains all infringement parameters | |
daily_driving_limit_exceeded | Array | Contains all excessive daily driving parameters | |
duration | Integer | Total driving duration driven over the daily driving limit | Seconds |
weekly_driving_limit_exceeded | Array | Contains all excessive weekly driving parameters | |
duration | Integer | Total driving duration driven over the weekly driving limit | Seconds |
data_gap_duration | Array | Contains all data gap duration parameters | |
duration | Integer | Total duration for which no data was received | Seconds |
Gli endpoint API, i parametri di richiesta e le risposte possono essere visualizzati in anteprima in “Swagger” attraverso questo link: https://api.fm-track.com