Glavna svrha API-ja za analizu vremena vozača je ispis podataka o radnom vremenu i vremenu odmora za određenog vozača. Izlazni podaci temelje se na funkcionalnosti analize vremena .
Primjer API zahtjeva za određeni upravljački program:
GET /upravljački programi/{driverId} /analiza-trenutnog-vremena?verzija=1&api_key= <...>
DOMAĆIN: api.fm-track.com
Vrsta sadržaja: aplikacija/json; skup znakova=UTF-8
Da bi ovaj API radio, sljedeći parametri su obavezni:
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 |
Primjer odgovora prikazan je u nastavku:
{ "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 } }
Ako je parametar ili API_key netočno unesen, sustav će odgovoriti s kodom pogreške, a svi mogući kodovi pogrešaka opisani su u odjeljku API-ji .
Sva polja odgovora koja se mogu primiti sa svakom vrstom parametra opisana su u sljedećoj tablici:
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 |
API krajnje točke, parametri zahtjeva i odgovori mogu se pregledati u „Swaggeru” putem ove poveznice: https://api.fm-track.com