Observation Events

This section provides examples for Observation event types.

Current APIs

URI Method Description
/ids-data-api/v1/observation-events/current/{deviceId}?<param>=<resourcePathName>
GET This API retrieves the most recent values of all the resourcePaths of the specified device. It also provides an option to further filter the data for a specific resourcePath by providing a query param.

Method: GET

URI: http://<<IDShostname>>/ids-data-api/v1/observation-events/current/352253064335021?param=device/0/pressure

Response: 200 OK


       [
    {
        "groupName": "enterprise_auto1",
        "deviceId": "352253064335021",
        "param": "device/0/pressure",
        "serverTime": "2017-01-25T10:23:33.341+0000",
        "value": "0.0",
        "subscriptionId": "e7a570f4-a175-4f2a-8080-d44400065ada",
        "customAttributes": {}
    }
]
    

Historical APIs

URI Method Description
/ids-data-api/v1/observation-events/history?
fromTime=<fromTime>&toTime=<toTime>&deviceId=<deviceIds>
&<param>=<resourcePathNames>
GET

This API retrieves all the values of the resourcePaths of the specified list of devices in the specified time range. It also provides an option to further filter the data for a list of specific resourcePaths by providing a query param.

Method: GET

URI:
http://<<IDShostname>>/ids-data-api/v1/observation-events/history
?fromTime=2017-01-25T00:00:00&
toTime=2020-06-16T23:00:00&deviceId=352253064335021&param=device/0/pressure&pageSize=3

Response: 200 OK


      [
    {
        "groupName": "enterprise_auto1",
        "deviceId": "352253064335021",
        "param": "device/0/pressure",
        "serverTime": "2017-01-25T10:23:33.341+0000",
        "value": "0.0",
        "subscriptionId": "e7a570f4-a175-4f2a-8080-d44400065ada",
        "customAttributes": {}
    }
]

Bulk APIs

URI Method Description
/ids-data-api/v1/observation-events/bulk?fromTime=<fromTime>&toTime=<toTime>
GET This API retrieves data across all devices in the specified time range and streams it to the client.

Method: GET

URI:
http://<<IDShostname>>/ids-data-api/v1/observation-events/
bulk?fromTime=2017-01-25T00:00:00&toTime=2020-06-18T23:00:00

Response: 200 OK

{"groupName":"enterprise_auto1","deviceId":"352253064335021","param":"device/0/pressure","serverTime":1485339813341,"value":"0.0","subscriptionId":"e7a570f4-a175-4f2a-8080-d44400065ada","customAttributes":{}}
{"groupName":"enterprise_auto1","deviceId":"352253064335022","param":"device/0/pressure","serverTime":1485339813341,"value":"0.0","subscriptionId":"e7a570f4-a175-4f2a-8080-d44400065ada","customAttributes":{}}
{"groupName":"enterprise_auto1","deviceId":"352253064335022","param":"vehicle/0/fuelLevel","serverTime":1485339813341,"value":"0.0","subscriptionId":"e7a570f4-a175-4f2a-8080-d44400065ada","customAttributes":{}}
{"groupName":"enterprise_auto1","deviceId":"352253064335283","param":"vehicle/0/fuelLevel","serverTime":1485339813438,"value":"0.0","subscriptionId":"e7a570f4-a175-4f2a-8080-d44400065ada","customAttributes":{}}