11.0 Mileage Reporting

11.1 Request Data

Back to Index

Important: Though the term mileage is used, this number may refer to kilometers, hours of operation or any other value collected during the asset inspection. Implementers should understand the nature of the inspections they are working with and the data collected.

Use this to obtain a report of the elapsed mileage for assets in the system or a specific asset for a specified time range. This value is computed using the following process. The reported mileage value for the earliest inspection within the specified time range is found. This value is subtracted from the reported mileage value for the latest inspection within the specified time range. The result is the elapsed mileage for that asset. To find the current reported mileage value for an asset use get assets.

Note: This action was added to protocol version 1.01.

Important: This action has changed in version 2. When requesting a specific asset using either the tag or fleet request types the asset type must also be specified. Version 1.x requests will assume a type of Standard (0) in these situations.

Required Information
Name Description
action showstats
operation mileage
format xml
startyear Year component of the report start date. Integer.
startmonth Month component of the report start date. Integer between 1 and 12 inclusive.
startday Day component of the report start date. Integer.
endyear Year component of the report end date. Integer.
endmonth Month component of the report end date. Integer between 1 and 12 inclusive.
endday Day component of the report end date. Integer.
Optional Information
logvers Log version for this API call. Acceptable values are:

  • 2 This allows for two now parameters to be sent; start and end
start Epoch timestamp for the report start
Please note, start is only valid when used with logvers=2
end Epoch timestamp for the report end
Please note, start is only valid when used with logvers=2
location Location to filter with. Text. If provided only assets assigned to that location will be returned. If location is not supplied or an empty location is specified, assets from all locations will be returned.

Note: If a target is specified the location filter is not applied.

showactiveonly If specified as ‘true’ only assets with an elapsed mileage greater than 0 will be returned and negative elapsed mileages will not be counted towards the total mileage for the fleet.
target Specific asset to report mile for, rather than entire fleet. If specified then reqtype must be specified as well. See asset target for details.
reqtype Flag to identify the key being used to query. Acceptable values:

  • tag Key is a Zonar RFID tag number. In version 2 a type must also be specified.
  • exsid Key is the external system id.
  • vin Key is the Vehicle Identification Number (VIN).
  • dbid Key is the internal id number. This is the most reliable key to use.
  • fleet Key is the asset fleet number. In version 2 a type must also be specified.
type When using reqtype of tag or fleet this must also be specified in version 2.X. In version 1.x type Standard (0) is assumed. See asset types for more details.