Back to index

GetFridgeAlarms_v1

This method wraps the R:COM Database view Ex_FridgeAlarms. See R:COM Form Message Database API document.

Parameters:

[in] usn The user-name that you need to use to authenticate on this interface.
[in] pwd The password that you need to use to authenticate on this interface.
[in] columns String array of the requested columns. For the full list of supported columns please refer to the Database API Documentation. If a non-existing column is requested then that column will appear in the returned XML and every entry in that column will be an empty string.
[in] options String parameter. This is currently unused and reserved for future versions of the API. Pass in an empty string.
earliestAlarmOnTime The time for and after which you would like to retrieve the data. The timestamp will be referenced against fridge alarm-on time.
Please make sure that you specify this in utc.
[in] startPointGeneration A start point expressed in terms of a generation number. For more on generation numbers and restart points, see the remarks section.
[in] requestedNumRows Specifies how many rows to return in this "chunk."
[out] lastGeneration The generation number of the last entry in the returned chunk.
[out] adjustedNumRows Each customer is configured with a minimum and maximum threshold. Maximum thresholds ensure no single response becomes too large. Minimum thresholds helps prevent the server being flooded with requests returning no data. If the client requests a number of rows outside these boundaries the number of rows returned will be adjusted.
Example: CustomerA has a minimum threshold of 100, and a maximum threshold of 1000. She sends a request for 2000 records. The adjustedNumRows will be 1000.
[out] errorMsg If an error happpens this string contains the error message. In case an error has happened (this variable contains a valid non-empty string) then the return value of Get_GPSReadings_v1 will not contain any usable data, do not try to parse it as an xml.
return value If the errorMsg variable is null or empty then the returned string contains the requested data in xml format. The xml has the following structure:
<?xml version="1.0" encoding="utf-16"?>
<root>
<EX_FridgeAlarms>
  <row VehicleID="58" VehicleTypeID="1" AlarmSpanID="30" VehicleName="5001-5401" AlarmCode="108" AlarmOnTime="2011-04-18 02:18:12Z" AlarmOffTime="2011-04-18 22:06:35Z" UpdateTimeStamp="2011-04-18 22:06:35Z" GenerationNumber="30" Severity="2" Description="Door Open Timeout" />
</EX_FridgeAlarms>
</root>
Please note this.

Remarks

Minimum R-COM Database version

0.803

Retrieving large amount of data

You cannot use this function to retrieve infinitely large amount of data in one call. In case you would like to get a large set of rows you will need to call this function several times. You can specify your preference about the number of rows returned in one function-call in requestedNumRows. If it is possible the webservice will use this number, but there are circumstances in which the webservice needs to adjust this number for performing the query. The real row number that was used for performing the query is retuned in adjustedNumRows.

To find out whether there is more data that was not returned with the previous call you should compare adjustedNumRows with the number of rows in the returned xml. If these two numbers match then it is likely that there are more rows to return. If the number of rows in the returned xml is smaller than ajustedNumRows then most probably you have retrieved all the data for now. No new rows will be returned until new data gets saved.

If you want to fetch the next set of data, you need to remember the value of lastGeneration from the last call and pass that value in as startPointGeneration to query the following set of rows.

There is a chance that you get the same rows more than once, your application needs to be prepared to handle this case.

Error messages

Please see this page.