Skip to main content
Omnitracs Knowledge Base

Driver->DriverViolations

DriverViolations (Driver Function) 

Returns violations for a driver for the ruleset and time period specified. The time period must be no longer than one month. See also: DriverViolations Request - Response Example

Note: Omnitracs does not recommend calling DriverViolations for all drivers in the fleet individually. They can use the GetViolationEvents to give the list of drivers that have at least one violation on a given day. Then use this driver list to call DriverViolations.

1. Call GetViolationEvents to get a list of drivers with any violation
2. Build list of drivers from step 1
3. For each driver in list in step 2, call DriverViolations for the day they had the violation from step 1.

XML Request

The DriverViolations function takes four parameters.

Parameter Type Description
DriverId String The driver ID of the driver for whom you want to view violations
RuleSet Enum The rule set for which you want to find violations; possible values are USA, CANMain (Canada south of the 60th parallel), or CANNorth (Canada north of the 60th parallel), USACalifornia, USAFlorida, USATexas, USAAlaska
Start dateTime The first time for which violation data is requested, expressed as the local time at the driver's depot. The web service truncates the TIME portion from the request and returns all violations that are between the Start and End DAY
End dateTime The last time for which violation data is requested, expressed as the local time at the driver's depot; cannot be more than one month after the Start time. The web service truncates the TIME portion from the request and returns all violations that are between the Start and End DAY
TimeResolutionInSeconds boolean This parameter specifies whether certain values in the response are returned in seconds or minutes. If true, values are returned in seconds; otherwise in minutes. This parameter is optional. If the parameter is omitted, then values in the response are returned in minutes. See the response description for the effected fields.
  
<soap:Body>  
    <DriverViolations xmlns="http://www.omnitracs.com">  
        <request>  
            <DriverId>string</DriverId>  
            <RuleSet>USA or CANMain or CANNorth or USACalifornia or USAFlorida or USATexas or USAAlaska</RuleSet>  
            <Start>dateTime</Start>  
            <End>dateTime</End>  
        </request>  
    </DriverViolations>  
</soap:Body>  

XML Response

If more than one violation is returned for the specified driver and time period, the XML response will have a <DriverViolationsData> section for each violation. The DriverViolations function returns the following values:

Parameter Type Description
TimeZone String The time zone of the requested depot
RuleSet Enum The rule set for these violations, echoed from the request
RestBreakViolations Integer The number of violations of the rest break clock, calculated under the specified rule set
DrivingViolations Integer The number of violations of the daily driving clock restrictions, calculated under the specified rule set
OnDutyViolations Integer The number of violations to the daily on-duty clock restrictions, calculated under the specified rule set
CumulativeOnDutyViolations Integer The number of violations to the duty-cycle clock restrictions, calculated under the specified rule set
ShiftViolations Integer For CANMain and CANNorth rule sets, the number of daily shift violations; 0 for any USA rule set
DayOffViolations Integer For CANMain and CANNorth rule sets, the number of day-off violations; 0 for any USA rule set
PassengerRuleViolations Integer The number of Passenger Rule violations.
DailyOffViolations Integer For CANMain and CANNorth rule sets, the number of DailyOff violations
DailyOffTwoHourViolations Integer For CANMain and CANNorth rule sets, the number of DailyOffTwoHours violations
DeferralDrivingViolations Integer For CANMain and CANNorth rule sets, the number of DeferralDriving violations
TotalOffDutyForDeferralViolations Integer For CANMain and CANNorth rule sets, the number of TotalOffDutyForDeferral violations
DeferralDay1OffDutyViolations Integer For CANMain and CANNorth rule sets, the number of DeferralDay1OffDuty violations
DeferralDay2OffDutyViolations Integer For CANMain and CANNorth rule sets, the number of DeferralDay2OffDuty violations
RestBreakAfterExemptionViolations Integer Number of rest break violations incurred immediately after deactivating rest break exemptions violations
Type Enum For each violation, the type of violation: Driving, OnDuty, CumulativeOnDuty, Shift, DayOff, RestBreak, PassengerRule, DailyOff, DailyOffTwoHours, DeferralDriving, DeferralTotalOffDuty, DeferralDay1OffDuty, DeferralDay2OffDuty, or RestBreakAfterExemption
Time dateTime For each violation, the time the violation occurred (if TimeResolutionInSeconds is false or omitted in the request, then Time will be truncated to the minute)
Duration Integer For each violation, the amount of time spent in violation (if TimeResolutionInSeconds is true in the request, then returned in seconds; otherwise minutes)
  
<soap:Body>  
    <DriverViolationsResponse xmlns="http://www.omnitracs.com">  
       <DriverViolationsResult>  
            <TimeZone>string</TimeZone>  
            <RuleSet>USA or CANMain or CANNorth or USACalifornia or USAFlorida or USATexas or USAAlaska</RuleSet>  
            <RestBreakViolations>int</RestBreakViolations>  
            <DrivingViolations>int</DrivingViolations>  
            <OnDutyViolations>int</OnDutyViolations>  
            <CumulativeOnDutyViolations>int</CumulativeOnDutyViolations>  
            <ShiftViolations>int</ShiftViolations>  
            <DayOffViolations>int</DayOffViolations>  
            <PassengerRuleViolations>int</PassengerRuleViolations>  
            <DailyOffViolations>0</DailyOffViolations>  
            <DailyOffTwoHourViolations>0</DailyOffTwoHourViolations>  
            <DeferralDrivingViolations>0</DeferralDrivingViolations>  
            <TotalOffDutyForDeferralViolations>0</TotalOffDutyForDeferralViolations>  
            <DeferralDay1OffDutyViolations>0</DeferralDay1OffDutyViolations>  
            <DeferralDay2OffDutyViolations>0</DeferralDay2OffDutyViolations>  
            <RestBreakAfterExemptionViolations>0</RestBreakAfterExemptionViolations>  
            <Violations>  
                <DriverViolationsData>  
                     <Type>Driving or OnDuty or CumulativeOnDuty or Shift or DayOff or RestBreak or PassengerRule or DailyOff or DailyOffTwoHours or DeferralDriving or DeferralTotalOffDuty or DeferralDay1OffDuty or DeferralDay2OffDuty or RestBreakAfterExemption</Type>  
                     <Time>dateTime</Time>  
                     <Duration>int</Duration>  
                </DriverViolationsData>  
                <DriverViolationsData>  
                     <Type>Driving or OnDuty or CumulativeOnDuty or Shift or DayOff or RestBreak or PassengerRule or DailyOff or DailyOffTwoHours or DeferralDriving or DeferralTotalOffDuty or DeferralDay1OffDuty or DeferralDay2OffDuty or RestBreakAfterExemption</Type>  
                     <Time>dateTime</Time>  
                     <Duration>int</Duration>  
                </DriverViolationsData>  
            </Violations>  
       </DriverViolationsResult>  
    </DriverViolationsResponse>  
</soap:Body>  

DriverViolations Request - Response Example

  • Was this article helpful?