Returns a list of the maximum speeds for asset(s) within a specified time range and optionally a specific location of interest. A single asset may be specified or information may be retrieved for all assets.
Note: This function is only available in version 2.X of the API.
Request Data
Required Information | |
---|---|
Name | Description |
action | showposition |
operation | speed |
format | xml or json - (json format only used with 'getfive' parameter listed below) |
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 | |
logvers | Acceptable values:
Note: If a value is not passed, |
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:
|
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. |
loilocation | If specified, the report will be created using position from inside the specified location of interest1. Value must be a location of interest name. |
getfive | A value of "t" is required. If specified, the report will return the previous 3 points (within 10 minutes) and the following 2 points (within 10 minutes) of the 'fromdate' specified. This makes the 'todate' not required and not used. The 'target' parameter is now required as an db id, the 'format' parameter must be 'json', and 'reqtype' must be 'dbid'. |
1 Location of Interest; called "Zone" in the GPS tools and reports found within the Ground Traffic Control web application.
Data Returned
The XML information returned is similar to the GPS Speed Report from Ground Traffic Control.
logvers=1 Speed Report Results - DTD
<!ELEMENT speedlist (assetspeed*)> <!ATTLIST speedlist ver CDATA #REQUIRED> <!ATTLIST speedlist count CDATA #REQUIRED> <!ATTLIST speedlist start CDATA #REQUIRED> <!ATTLIST speedlist end CDATA #REQUIRED>
<!ELEMENT assetspeed (speed)> <!ATTLIST assetspeed tag CDATA #REQUIRED> <!ATTLIST assetspeed fleet CDATA #REQUIRED> <!ATTLIST assetspeed type CDATA #REQUIRED> <!ATTLIST assetspeed id CDATA #REQUIRED> <!ATTLIST assetspeed latlong CDATA> <!ATTLIST assetspeed unit CDATA> <!ATTLIST assetspeed timestamp CDATA>
<!ELEMENT speed (#PCDATA)>
logvers=2 Speed Report Results - DTD
<!ELEMENT speedlist (assetspeed*)> <!ATTLIST speedlist ver CDATA #REQUIRED> <!ATTLIST speedlist count CDATA #REQUIRED> <!ATTLIST speedlist start CDATA #REQUIRED> <!ATTLIST speedlist end CDATA #REQUIRED>
<!ELEMENT assetspeed (speed)> <!ATTLIST assetspeed tag CDATA #REQUIRED> <!ATTLIST assetspeed fleet CDATA #REQUIRED> <!ATTLIST assetspeed type CDATA #REQUIRED> <!ATTLIST assetspeed id CDATA #REQUIRED> <!ATTLIST assetspeed latlong CDATA> <!ATTLIST assetspeed unit CDATA> <!ATTLIST assetspeed timestamp CDATA> <!ATTLIST assetspeed location CDATA>
<!ELEMENT speed (#PCDATA)>
Reply Data | |
---|---|
Name | Description |
version | The version number of the API 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. |
timestamp | The timestamp when the speed event occurred. An epoch timestamp. |
latlong | The latitude and longitude position of where the longest idle occurred (format: lat,long). |
unit | The measurement unit the speed is reported in. |
speed | The maximum reported speed for the asset. A floating point number. |
Example Request (Get the maximum speeds for all assets)
https://omi.zonarsystems.net/interface.php?customer=zzo2544&username=zonar&password=secret.pw.2019&action=showposition&operation=speed&format=xml&customer=abc1234&fromdate=1141397988&todate=1141398000&vers=2
Example Success Reply XML
<?xml version="1.0"?>
<speedlist ver="1" count="9" start="1141397988" end="1141398000">
<assetspeed tag="138030398" fleet="030398G" type="0" id="23" latlong="-13628411.5793483,5949175.31992437" unit="Mile/Hour">
<speed>56.6</speed>
</assetspeed>
<assetspeed tag="138030370" fleet="030370G" type="0" id="51" latlong="-13621895.8269131,5955939.7570561" unit="Mile/Hour">
<speed>42.2</speed>
</assetspeed>
<assetspeed tag="138021079" fleet="021079G" type="0" id="137" latlong="-13638723.4933987,5943883.50417367" unit="Mile/Hour">
<speed>30.8</speed>
</assetspeed>
<assetspeed tag="138030349" fleet="030349G" type="0" id="72" latlong="-13637483.1159725,5943995.60547843" unit="Mile/Hour">
<speed>25.3</speed>
</assetspeed>
<assetspeed tag="138030414" fleet="030414G" type="0" id="7" latlong="-13626373.497583,5942116.19445632" unit="Mile/Hour">
<speed>23.6</speed>
</assetspeed>
<assetspeed tag="138030947" fleet="030947G" type="0" id="1" latlong="-13640232.072874,5953830.6404108" unit="Mile/Hour">
<speed>21.5</speed>
</assetspeed>
<assetspeed tag="138030402" fleet="030402G" type="0" id="19" latlong="-13638398.5852009,5951168.30394289" unit="Mile/Hour">
<speed>19.4</speed>
</assetspeed>
<assetspeed tag="138021081" fleet="021081G" type="0" id="135" latlong="-13631670.6800802,5939593.32424456" unit="Mile/Hour">
<speed>18.3</speed>
</assetspeed>
<assetspeed tag="138030397" fleet="030397G" type="0" id="24" latlong="-13625492.0364591,5950463.72297835" unit="Mile/Hour">
<speed>15.7</speed>
</assetspeed>
</speedlist>
Example Request (Get the maximum speed for a specific asset)
https://omi.zonarsystems.net/interface.php?customer=zzo2544&username=zonar&password=secret.pw.2019&action=showposition&operation=speed&format=xml&customer=abc1234&target=138021074&reqtype=tag&fromdate=1141220175&todate=1149551361&vers=2
Example Success Reply XML
<?xml version="1.0"?>
<speedlist ver="1" count="1" start="1141220175" end="1149551361">
<assetspeed tag="138021074" fleet="021074G" type="0" id="139" latlong="-13627733.1872394,5950670.4437775" unit="Mile/Hour">
<speed>67.2</speed>
</assetspeed>
</speedlist>
JSON Get Five Speed Report Results - DTD
<!ELEMENT eventlist (ver, count, start, end, maxts, assetevents*)> <!ATTLIST ver CDATA #REQUIRED> <!ATTLIST count CDATA #REQUIRED> <!ATTLIST start CDATA #REQUIRED> <!ATTLIST end CDATA #REQUIRED> <!ATTLIST maxts CDATA #REQUIRED>
<!ELEMENT assetevents (fleet, id, lat, lng, heading, unit, dt, speed, power)> <!ATTLIST fleet CDATA #REQUIRED> <!ATTLIST id CDATA #REQUIRED> <!ATTLIST lat CDATA #REQUIRED> <!ATTLIST lng CDATA #REQUIRED> <!ATTLIST heading CDATA #REQUIRED> <!ATTLIST unit CDATA #REQUIRED> <!ATTLIST dt CDATA> <!ATTLIST speed CDATA> <!ATTLIST power CDATA>
Reply Data | |
---|---|
Name | Description |
version | The version number of the API call and return data. |
count | The number of results returned. |
start | The 'start' epoch time (fromdate - 10 minutes). |
end | The 'end' epoch time (fromdate + 10 minutes). |
maxts | The time epoch of the max speed event (fromdate) |
assetevents | Returns null if no events or the grouped values listed below: |
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. |
lat | The latitude of the point being returned. A floating point number. |
lng | The longitude of the point being returned. A floating point number. |
heading | A representation of the assets heading in degrees for the point being returned. A floating point number. |
unit | The measurement unit the speed is reported in. ("MPH" or "KPH") |
dt | The date/time String for the point being returned. ex. "Mon 27 Sep 2010 08:44" |
speed | The speed for the point being returned. A floating point number representing MPH or KPH. |
power | Boolean value representing the assets power state (true for on and false for off) for the point being returned. |
Example Request
https://omi.zonarsystems.net/interface.php?customer=zzo2544&username=zonar&password=secret.pw.2019&action=showposition&operation=speed&format=json&getfive=t&customer=abc1234&fromdate=1141397988&vers=2&reqtype=dbid
Example Success Reply JSON
{"eventlist":{"ver":1,"count":0,"start":1141390788,"end":1141405188,"maxts":"1141397988","assetevents":null}}