Request Data
Use this request to create a report of assets with expirys that have or are about to expire.
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 | showexpire |
operation | asset |
format | xml |
rpttype | The type of report to create. Acceptable values:
|
Optional Information | |
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. Must be a valid location name. |
threshold | If a date or value rpttype is specified this may be provided. Integer, represents either either the remaining days for a time based expire or the remaining value units for value based expires. When using threshold with rpttype value assets with expiry value equal to or below the threshold will be returned. |
target | Must be supplied if a rpttype of assetdate or assetvalue is specified. Represents the specific asset to report on. |
reqtype | Flag to identify the key being used to query. 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. |
expdatetype | Create a report only for a specific expiry type. Must be a valid expiry type.
Note:This parameter is only used in conjunction with |
Data Returned
Returned information: A list of assets with expiry information.
DTD
<!ELEMENT assetexpirelist (assetexpire*)>
<!ATTLIST assetexpirelist ver CDATA #REQUIRED>
<!ELEMENT assetexpire (name, vin, fleet,location, expire)>
<!ATTLIST assetexpire dbid CDATA #REQUIRED>
<!ELEMENT name (#PCDATA)>
<!ELEMENT vin (#PCDATA)>
<!ELEMENT fleet (#PCDATA)>
<!ELEMENT location (#PCDATA)>
<!ELEMENT tag (#PCDATA)>
<!ELEMENT expire (label, exp, remaining, currval*)>
<!ATTLIST expire exptype (date|value) #REQUIRED>
<!ELEMENT label (#PCDATA)>
<!ELEMENT exp (#PCDATA)>
<!ELEMENT remaining (#PCDATA)>
<!ELEMENT currval (#PCDATA)>
The dbid
attribute is the database id number of the asset. In protocol version 1.07 the tag
element was added to provide the assets's Zonar RFID tag number.
Time based expirys will not have a currval element as the current value is the time the request was made. Value based expirys will include this element as the currently reported value for the asset in question.
Example Request
Return all assets with time based expirys that will occur within 10 days.
https://omi.zonarsystems.net/interface.php?customer=zzo2544&username=zonar&password=secret.pw.2019&action=showexpire&operation=asset&format=xml&rpttype=date&threshold=10
Example Success Reply
<?xml version="1.0"?>
<assetexpirelist ver="1.07">
<assetexpire dbid="26">
<name>RTS-009</name>
<vin>TB69889K54112M0</vin>
<fleet>0002</fleet>
<location>Home</location>
<tag>211222</tag>
<expire exptype="date">
<label>pm service 3</label>
<exp>2004-11-19</exp>
<remaining>3</remaining>
</expire>
</assetexpire>
</assetexpirelist>
Example Request
Return all assets with value based expirys that will occur within 300 units.
https://development.zonarsystems.net/interface.php?action=showexpire&operation=asset&format=xml&rpttype=value&threshold=300
Example Success Reply
<?xml version="1.0"?>
<assetexpirelist ver="1.07">
<assetexpire dbid="15">
<name>WAD765</name>
<vin>VIN1990909876A123</vin>
<fleet>2501</fleet>
<location>Zonar Seattle</location>
<tag>321</tag>
<expire exptype="value">
<label>500 Hour Service</label>
<exp>500</exp>
<remaining>250</remaining>
<currval>250</currval>
</expire>
</assetexpire>
<assetexpire dbid="15">
<name>WAD765</name>
<vin>VIN1990909876A123</vin>
<fleet>2501</fleet>
<location>Zonar Seattle</location>
<tag>321</tag>
<expire exptype="value">
<label>750 Hour Refer Service</label>
<exp>750</exp>
<remaining>40</remaining>
<currval>710</currval>
</expire>
</assetexpire>
<assetexpire dbid="29">
<name>ASD888</name>
<vin>1SV986632HBAA9987</vin>
<fleet>6402</fleet>
<location>Zonar Seattle</location>
<tag>296</tag>
<expire exptype="value">
<label>Oil Change</label>
<exp>1000</exp>
<remaining>-200</remaining>
<currval>1200</currval>
</expire>
</assetexpire>
</assetexpirelist>