Driver Time Analysis API

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:

ParameterTypeDescription
driverIdStringDriver identifier (This ID can be acquired by sending a request to the Drivers API)
versionStringVersion of the API, currently only version=1 is available
api_keyStringUser 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:

NameTypeDescriptionUnits
typeStringIndicates whether the driver is primary or secondary, that is, whether the driver card is inserted into the first or second card slot in the tachographText
calculated_untilDateDate and time when the request was made
Format: "yyyy-mm-ddThh:mm:ss.sssZ"
According to ISO8601
stateArrayContains all driver state parameters
activityStringThe driver state when the request was madeText
started_atDateDate and time when the driver entered a state
Format: "yyyy-mm-ddThh:mm:ss.sssZ"
According to ISO8601
durationIntegerTotal time the driver was in a stateSeconds
current_dayArrayContains all current day parameters
driving_statusStringIndicates whether there is a single driver or a crewText
drivingArrayContains all driving parameters
regularArrayContains all regular driving parameters
durationIntegerTotal regular driving durationSeconds
duration_limitIntegerThe maximum allowed regular driving durationSeconds
extraArrayContains extra driving parameters
durationIntegerTotal extra driving durationSeconds
duration_limitIntegerThe maximum allowed extra driving durationSeconds
workingArrayContains all daily working parameters
durationIntegerTotal daily working durationSeconds
restingArrayContains all daily rest parameters
rest_in_progressBooleanIndicates if the driver was resting when the request was madeTrue - False
next_restDateDate and time of the next daily rest
Format: "yyyy-mm-ddThh:mm:ss.sssZ"
According to ISO8601
current_weekArrayContains all current week parameters
drivingArrayContains all driving parameters
durationIntegerTotal weekly driving durationSeconds
duration_limitIntegerThe maximum allowed weekly driving durationSeconds
extended_daily_driving_periodsArrayContains all extended daily driving period parameters
usedIntegerThe amount of used extended driving periodsNumber
usage_limitIntegerThe maximum amount of extended driving periodsNumber
workingArrayContains all weekly working parameters
durationIntegerTotal weekly working durationSeconds
restingArrayContains all weekly rest parameters
rest_in_progressBooleanIndicates if the driver was resting when the request was madeTrue - False
next_restDateDate and time of the next weekly rest
Format: "yyyy-mm-ddThh:mm:ss.sssZ"
According to ISO8601
reduced_daily_restsArrayContains all reduced daily rest parameters
usedIntegerThe amount of used reduced daily rest periodsNumber
usage_limitIntegerThe maximum amount of reduced daily rest periodsNumber
previous_weekArrayContains all previous week parameters
drivingArrayContains all driving parameters
durationIntegerTotal driving duration the previous weekSeconds
duration_limitIntegerThe maximum allowed weekly driving durationSeconds
restingArrayContains all resting parameters for the previous week
durationIntegerTotal resting duration the previous weekSeconds
infringementsArrayContains all infringement parameters
daily_driving_limit_exceededArrayContains all excessive daily driving parameters
durationIntegerTotal driving duration driven over the daily driving limitSeconds
weekly_driving_limit_exceededArrayContains all excessive weekly driving parameters
durationIntegerTotal driving duration driven over the weekly driving limitSeconds
data_gap_durationArrayContains all data gap duration parameters
durationIntegerTotal duration for which no data was receivedSeconds

API endpoints, request parameters and responses can be previewed in “Swagger” through this link: https://api.fm-track.com