Driver Violations are recorded instances wherein the Driver has committed Driving, Shift, or Cycle Violations. Whenever a Driver has exceeded the maximum time allowed for an OnDuty or a Driving status within a given time period or a series of time periods, these Driver Violations are recorded.
Fields
Tag | Data Type | Description |
accountId | Long | The id of the Account that owns this record. |
driverHistoryId | Long | The id for associated Driver History record that triggered this Driver Violation |
id | Auto-incremented Long | Unique Identifier |
lastChangedDate | Text | Auto-generated timestamp of the last change made to this record Note: Format is in timestamp and timezone (YYYY-MM-DDTHH:MM:SS.sssZ, e.g: 1970-01-01T00:00:00.000Z) |
limit | Duration | The limit at which when the violation would occur. |
subsetId | Long | Indicates the Subset of the Terminal where the Driver is assigned |
terminalId | Long | Id of the Terminal where the Driver is assigned |
timestamp | Text | Time stamp for Driver Violation Note: Format is in timestamp and timezone (YYYY-MM-DDTHH:MM:SS.sssZ, e.g: 1970-01-01T00:00:00.000Z) |
userId | Long | The id of the Driver who owns the Violation. |
violationName | Character (255) | Can either be one of the following:
Canada Rules:
|
Read
API PATH: | /api/v2/driverViolations |
METHOD: | GET |
PARAMETERS: | user-id – Retrieves matching records for a specific User (e.g. user-id=496650, all Users by default) driver-history-id – Retrieves matching records for a specific Driver History (e.g. driver-history-id=4826036, all Driver Histories by default) terminal-id – Retrieves matching records with Drivers assigned on the specified Terminal (e.g. terminal-id=189, use terminal-id=0 for the default main office Terminal, returns drivers from all Terminals by default) subset-id – Retrieves matching records whose subsetId of the Driver matches the specified parameter (e.g. subset-id=940, returns drivers from all subsets by default) violation-name – Retrieves matching records with the specified Driver Violation name (e.g. violation-name=BREAK_DRIVE_HOURS, all Driver Violations by default) from-timestamp – Retrieves matching records that occurred on or after the specified timestamp (e.g. from-timestamp=2016-07-05T08:00:35.833Z, all timestamps by default) to-timestamp – Retrieves matching records that occurred on or before the specified timestamp (e.g. to-timestamp=2016-07-05T08:00:35.833Z, all timestamps by default) from-change-timestamp – Retrieves matching records that were changed after the specified timestamp (e.g. from-change-timestamp=2016-07-05T08:00:35.833Z, all timestamps by default) to-change-timestamp – Retrieves matching records that were changed before the specified timestamp (e.g. to-change-timestamp=2016-07-05T08:00:35.833Z, REQUIRES from-change-timestamp) system – Retrieves matching records based on Driver type, depending on the boolean value specified. (e.g. system=true, all by default) If true, only the unidentifiedDriver Violations is retrieved. If false, only actual Drivers are retrieved. Wild-carding using system=* or system=true,false will retrieve all Drivers offset – Retrieves matching records after an offset value (e.g. offset=2) limit – Retrieves a number of records per page specified by the value (e.g. limit=10) |
SORTING: | sort=id – Sort records by their id field in ascending order (DEFAULT) sort=-id – Sort records by their id field in descending order sort=timestamp – Sort records by their timestamp field in ascending order sort=-timestamp – Sort records by their timestamp field in descending order sort=last-changed-date– Sort records by their last change date field in ascending order sort=-last-changed-date– Sort records by their last change date field in descending order |
QUERY STRING EXAMPLES: | Get the Driver Violation with the specified id: api/v2/driverViolations/2118010 Get all Driver Violations with a specific Asset : ?user-id=1250887 Get two Driver Violations of the current Account with an offset of 1 : ?offset=1&limit=2 Get all Driver Violations of the current Account sorted by timestamp in ascending order: ?sort=timestamp |
EXAMPLE RESPONSE: |
[ { "userId": 1250887, "driverHistoryId": 4826036, "timestamp": "2018-06-11T12:00:00.000Z", "violationName": "BREAK_DRIVE_HOURS", "limit": "PT1800S", "terminalId": 12811, "subsetId": 17674, "accountId": 1248280, "id": 2118010, "lastChangedDate": "2018-06-11T12:05:00.000Z" } ] |
API error calls
ERROR MESSAGE | POSSIBLE CAUSES |
POST is not supported. | POST method is not allowed |
PUT is not supported. | PUT method is not allowed |
DELETE is not supported. | DELETE method is not allowed |