Retrieving Logged Data

Data logs can be retrieved using a REST request or WebSocket request.  WebSockets allows you to get the data log data faster. WebSockets allow you to get all logs during a specified time period.  If you need to get specific entries, then use IAP/REST. IAP/MQ cannot be used to retrieve logged data.

IAP/REST

An event is an entry in the data and event log.  The data and event log can contain many events.  Each event may be tagged with one or more categories.  Storage and retention rules are specified for each category. 

Datapoint Value Reporting

Returns event entries from the data and event log, subject to any specified filters. If event_id is “***” or omitted, then all events can be returned, subject to the specified filters. See Log Events in the API Reference for more information.

GET     /iap/log/ev/{event_id}


IAP/WS

WebSockets can be used to get logs for a specific duration. 

Datapoint Value Reporting

Returns event entries from the data and event log, subject to any specified filters. This WebSocket is only open while retrieving the logs for this specific request. An "end" update means there is no more data and the WebSocket will be automatically closed by the SmartServer.

Special characters in the request, depending on location, may need to be encoded before sending the request to the SmartServer.

Gets all logs for specific time time period:

GET     /iap/ws?value=*+utc>{starting timestamp}&utc<={ending timestamp}


Gets all logs for specific device for specific time time period:

GET     /iap/ws?dev={device id or device name}&value=*+utc>{starting timestamp}&utc<={ending timestamp}


Gets all logs for specific datapoint for specific time time period:

GET     /iap/ws?dev={device id or device name}&blockName={block name}&blockIndex={block Index}&dpName={block Index}&value=*+utc>{starting timestamp}&utc<={ending timestamp}


Example response: "end" means no more data updates.

{"deviceId":5,"deviceQualifier":"17qam88/bacnet/4","deviceName":"Tstat-01","blockName":"AV","blockIndex":7,"datapointName":"Room Temperature","deviceHealth":"normal","dpQualifier":"17qam88/bacnet/4/AV/7/Room Temperature","id":1605,"utc":"2021-05-21T15:20:47.000Z[UTC]","local":"2021-05-21T08:20:47.000-07:00[America/Los_Angeles]","value":80.40000153,"tags":{"log_level_1":"1"},"name":"Room Temperature","localizedValue":80.40000153}

"end"


Example no data response:

"end"