The main purpose of the Driver Time Analysis API is to output driver working and resting time data for a specific driver. The outputted data is based on Time Analysis functionality.
API request example for a specific driver:
GET /drivers/{driverId}/current-time-analysis?version=1&api_key=<…>
HOST:api.fm-track.com
Content-Type:application/json;charset=UTF-8
For this API to work, the following parameters are mandatory:
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 |
A response example is shown below:
{ "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 } }
If a parameter or the API_key was inputted incorrectly, the system will respond with an error code, all possible error codes are described in the APIs section.
All response fields that can be received with every type of parameter are described in the next table:
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 endpoints, request parameters and responses can be previewed in “Swagger” through this link: https://api.fm-track.com