24. GPS Idle/Stop Report

Returns a list of idle/stop times for assets that meet the given filter restrictions. Data returned is similar to the GPS Idle/Stop Report results returned on the website.

24.1 Request Data

There are 2 types of requests for the idle and stop times. These requests match the 2 different types of result tables displayed in the GPS Idle/Stop Report on the website. The first request type displays the idle/stop totals, which is a summary of all the idle and stop times. The second request type displays a list of all the idle or stop times for a single asset. In version 2, the long/lat output values are swapped.

The following are parameters that are required and optional for these requests.

Idle/Stop "Totals" Request:
Required Information
Name Description
action showposition
operation idlestoptotals
format xml
fromdate epoch time. Results will be from events that occurred during or after this time.
todate epoch time. Results will be from events the occurred during or before this time.
Optional Information
target Query for a specific asset and only return information for that asset. If specified a reqtype (request type) must be specified as well.
reqtype Flag to identify the key being used to identify the asset. Acceptable values:
  • tag Key is a Zonar RFID tag number. In version 2.X 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 database id number. This is the most reliable key to use.
  • fleet Key is the asset fleet number. In version 2.X a type must also be specified.
type When using reqtype of tag or fleet this must also be specified in version 2. In version 1.x type Standard (0) is assumed. See asset types for more details.
loiinclude Flag to notate if the results should only be inside or outside of the given location of interest. Acceptable values:
  • include Include results only within given LOI. loilocation must be used.
  • exclude Exclude results within given LOI. loilocation must be used.
loilocation When using loiinclude, query for results that only occurred within or outside a specific location of interest. Value must be a location of interest name.
idletimecomp Component to notate if idle/stop times must be shorter than or longer than the given time length. Acceptable values:
  • > Only show idle/stop times longer than the given time length. idletime must be used.
  • < Only show idle/stop times shorter than the given time length. idletime must be used.
idletime When using idletimecomp, only show idle/stop times shorter than or longer than this time length. Valid format is:
  • HH:MM:SS Time period must contain 2 digits for Hours, Minutes and Seconds, separated by colons e.g. 00:05:30
tstype A flag to indicate what the starttime/endtime variables represent. If nothing is passed log is assumed. Acceptable values are:
  • log Timestamp is the log time for the idle/stop event.
  • load Timestamp is the time that the idle/stop event was added to the Zonar-Web system. Events added between fromdate/todate will be returned.

Idle/Stop "All" Request:
Required Information
Name Description
action showposition
operation idlestopallidle or idlestopallstop. idlestopallidle shows all idle times and idlestopallstop shows all stop times.
format xml
fromdate epoch time. Results will be from events that occurred during or after this time.
todate epoch time. Results will be from events the occurred during or before this time.
Optional Information
target Query for a specific asset and only return information for that asset. If specified a reqtype (request type) must be specified as well.
*Please note that if not specified then all assets will be shown in the specified date range.
reqtype Flag to identify the key being used to identify the asset. Acceptable values:
  • tag Key is a Zonar RFID tag number. In version 2.X 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 database id number. This is the most reliable key to use.
  • fleet Key is the asset fleet number. In version 2.X a type must also be specified.
type When using reqtype of tag or fleet this must also be specified in version 2. In version 1.x type Standard (0) is assumed. See asset types for more details.
loiinclude Flag to notate if the results should only be inside or outside of the given location of interest. Acceptable values:
  • include Include results only within given LOI*. loilocation must be used.
  • exclude Exclude results within given LOI*. loilocation must be used.
loilocation When using loiinclude, query for results that only occurred within or outside a specific location of interest. Value must be a location of interest name.
idletimecomp Component to notate if idle/stop times must be shorter than or longer than the given time length. Acceptable values:
  • > Only show idle/stop times longer than the given time length. idletime must be used.
  • < Only show idle/stop times shorter than the given time length. idletime must be used.
idletime When using idletimecomp, only show idle/stop times shorter than or longer than this time length. Valid format is:
  • HH:MM:SS Time period must contain 2 digits for Hours, Minutes and Seconds, separated by colons e.g. 00:05:30
tstype A flag to indicate what the starttime/endtime variables represent. If nothing is passed log is assumed. Acceptable values are:
  • log Timestamp is the log time for the idle/stop event.
  • load Timestamp is the time that the idle/stop event was added to the Zonar-Web system. Events added between fromdate/todate will be returned.

24.1A Specifying a Particular Asset (Asset Target)

The target parameter may be used to request data for a specific asset. If used the type of target must be specified as described above. When using Version 2.X if the target type is tag or fleet the asset type must also be specified. See asset types for more details.

24.2 Data Returned

The returned information is similar to the 2 different results of the GPS Idle/Stop Report on the website:

Idle/Stop "Totals" Results: DTD:
<!ELEMENT idlestoplist (assetidle*)>
<!ATTLIST idlestoplist ver CDATA #REQUIRED>
<!ATTLIST idlestoplist count CDATA #REQUIRED>
<!ATTLIST idlestoplist start CDATA #REQUIRED>
<!ATTLIST idlestoplist end CDATA #REQUIRED>

<!ELEMENT assetidle (idlecount, maxidle, stopcount, maxstop )>
<!ATTLIST assetidle tag CDATA #REQUIRED>
<!ATTLIST assetidle fleet CDATA #REQUIRED>
<!ATTLIST assetidle type CDATA #REQUIRED>
<!ATTLIST assetidle id CDATA #REQUIRED>
<!ATTLIST assetidle exsid CDATA #REQUIRED>

<!ELEMENT idlecount (#PCDATA)>
<!ELEMENT maxidle (#PCDATA)>
<!ATTLIST maxidle time CDATA>
<!ATTLIST maxidle longlat CDATA>
<!ELEMENT totalidle (#PCDATA)>

<!ELEMENT stopcount (#PCDATA)>
<!ELEMENT maxstop (#PCDATA)>
<!ATTLIST maxstop time CDATA>
<!ATTLIST maxstop longlat CDATA>
<!ELEMENT totalstop (#PCDATA)>

Idle/Stop "Totals" Results:
Reply Data
Name Description
version The version number of the OMI call and return data.
count The number of results returned.
start The request epoch time (fromdate).
end The request epoch time (todate).
tag The Zonar RFID tag number assigned to the asset. Coupled with the Type, this is usually the means by which an asset is identified in an inspection. The combination of tag number and type must be unique for each asset.
fleet Fleet number. An arbitrary text string of up to 20 characters in length. If the asset is a vehicle this is intended to be the user assigned identification for the vehicle. This is usually labeled 'Asset No.' in the web interface. The combination of fleet number and type must be unique for each asset. All assets must have a fleet number.
type The asset type identifier. The combination of tag number and type or fleet number and type is used to uniquely identify the asset. Text, 32 characters maximum length. All assets have a type.
id (asset) The internal database identifier for the asset object. This is the primary means of identifying an asset and how the asset is linked to other objects.
exsid (asset) The external identifier for the asset object.
idlecount The number of times the asset was idle.
time The length of time that the longest idle lasted (format: HH:MM:SS).
longlat The longitude and latitude position of where the longest idle occurred (format: long,lat). * Version 2 (format: lat,long)
totalidle The total length of time all idles lasted (format: HH:MM:SS).
stopcount The number of times the asset was stopped.
time The length of time that the longest stop lasted (format: HH:MM:SS).
latlong The longitude and latitude position of where the longest stop occurred (format: long,lat). * Version 2 (format: lat,long)
totalstop The total length of time all stops lasted (format: HH:MM:SS).


Idle/Stop "All" Results: DTD:
<!ELEMENT eventlist (event*)>
<!ATTLIST eventlist ver CDATA #REQUIRED>
<!ATTLIST eventlist count CDATA #REQUIRED>
<!ATTLIST eventlist start CDATA #REQUIRED>
<!ATTLIST eventlist end CDATA #REQUIRED>


(*If an asset is not specified
<!ELEMENT assetidle (assetidle*)>
<!ATTLIST assetidle tag CDATA #REQUIRED>
<!ATTLIST assetidle fleet CDATA #REQUIRED>
<!ATTLIST assetidle id CDATA #REQUIRED>
<!ATTLIST assetidle exsid CDATA #REQUIRED>)



<!ELEMENT event (from, to, length, longlat )>
<!ATTLIST event type CDATA #REQUIRED>

<!ELEMENT from (#PCDATA)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT length (#PCDATA)>
<!ELEMENT longlat (#PCDATA)>

Idle/Stop "All" Results:
Reply Data
Name Description
version The version number of the OMI call and return data.
count The number of results returned.
start The request epoch time (fromdate).
end The request epoch time (todate).
If No Asset is Specified
tag The Zonar RFID tag number assigned to the asset. Coupled with the Type, this is usually the means by which an asset is identified in an inspection. The combination of tag number and type must be unique for each asset.
fleet Fleet number. An arbitrary text string of up to 20 characters in length. If the asset is a vehicle this is intended to be the user assigned identification for the vehicle. This is usually labeled 'Asset No.' in the web interface. The combination of fleet number and type must be unique for each asset. All assets must have a fleet number.
id (asset) The internal database identifier for the asset object. This is the primary means of identifying an asset and how the asset is linked to other objects.
exsid (asset) The external identifier for the asset object.
 
type The type of event. Valid values are:
  • idle an idle event
  • stop a stop event
from The epoch start time for the returned distance (may not be equal to start).
to The epoch end time for the returned distance (may not be equal to end).
length The length of time that the idle/stop lasted (format: HH:MM:SS).
longlat The longitude and latitude position of where the idle/stop occurred (format: long,lat). * Version 2 (format: lat,long)

Example "Totals" Request:

http://development.zonarsystems.net/interface.php?action=showposition&operation=idlestoptotals
   &fromdate=1151737200&todate=1154156340&loiinclude=exclude&loilocation=Zonar_HQ
   &idletimecomp=%3C&idletime=1:00:00&target=58&reqtype=dbid

Example "Totals" Success Reply (XML):

<idlestoplist ver="1" count="1" start="1151737200" end="1154156340">
  <assetidle tag="333" fleet="0003" type="0" id="58" exsid="325">
    <idlecount>3</idlecount>
    <maxidle time="00:00:13" longlat="-122.2949977,47.4285626"/>
    <totalidle>00:00:17</totalidle>
    <stopcount>0</stopcount>
    <maxstop time="" longlat=""/>
    <totalstop/>
  </assetidle>
</idlestoplist>

Example "All" Request (If no asset is specified):

http://development.zonarsystems.net/interface.php?action=showposition&operation=idlestopallidle
&fromdate=1151737200&todate=1154156340&loiinclude=exclude&loilocation=Zonar_HQ&idletimecomp=%3C&idletime=1:00:00

Example "All" Success Reply (XML):

<eventlist ver="1" count="3" start="1151737200" end="1154156340">
  <assetidle tag="333" fleet="0003" id="58" exsid="325">
   <event type="idle">
     <from>1153497364</from>
     <to>1153497377</to>
     <length>00:00:13</length>
     <longlat>-122.2949977,47.4285626</longlat>
   </event>
  </assetidle>
  <assetidle tag="333" fleet="0003" id="58" exsid="325">
   <event type="idle">
     <from>1153497323</from>
     <to>1153497326</to>
     <length>00:00:03</length>
     <longlat>-122.2961075,47.4296844</longlat>
   </event>
  </assetidle>
  <assetidle tag="333" fleet="0003" id="58" exsid="325">
   <event type="idle">
     <from>1153497312</from>
     <to>1153497313</to>
     <length>00:00:01</length>
     <longlat>-122.2962001,47.4298112</longlat>
   </event>
  </assetidle>
</eventlist>

Example "All" Request:

http://development.zonarsystems.net/interface.php?action=showposition&operation=idlestopallidle
   &fromdate=1151737200&todate=1154156340&target=58&reqtype=dbid&loiinclude=exclude&loilocation=Zonar_HQ
   &idletimecomp=%3C&idletime=1:00:00

Example Success Reply (asset 58 is specified):

<eventlist ver="1" count="3" start="1151737200" end="1154156340">
  <event type="idle">
    <from>1153497364</from>
    <to>1153497377</to>
    <length>00:00:13</length>
    <longlat>-122.2949977,47.4285626</longlat>
  </event>
  <event type="idle">
    <from>1153497323</from>
    <to>1153497326</to>
    <length>00:00:03</length>
    <longlat>-122.2961075,47.4296844</longlat>
  </event>
  <event type="idle">
    <from>1153497312</from>
    <to>1153497313</to>
    <length>00:00:01</length>
    <longlat>-122.2962001,47.4298112</longlat>
  </event>
</eventlist>


*LOI means Location of Interest; called "Zone" in GPS tools and reports in Ground Traffic Control web application.