8 Get Data By Count

This API Can be used to draw the most recent data of a device

Get Data by Date Range

Method

POST

API

https://iot.dialog.lk/expand_iot/solarservice/getDataByCount

Headers

IotMife-AccessToken : your IoTMife token here
X-Key               : your X-Key here
Accept              : application/json
Content-Type        : application/json

Body

Note : please change only the highlighted areas

{
 "mac_address" : "",
 "eventName" : "",
 "noOfEvents" :
}

Response


{
    "responseHeader": {
        "status": 0,
        "QTime": 1,
        "params": {
            "sort": "timestamp_s desc",
            "indent": "true",
            "q": "mac_s:xxxxxxxx",
            "wt": "json",
            "rows": "5"
        }
    },
    "response": {
        "numFound": 221,
        "start": 0,
        "docs": [
            {
                "stateName_s": "none",
                "userId_s": "yyyy",
                "deviceId_s": "2413",
                "time_s": "2018-3-15T15:26:48.868Z",
                "timestamp_s": "1521127608868",
                "mac_s": "9033215437939420",
                "humidity": "0.98",
                "temperature": "0.0",
                "id": "yyyy-2413-1521127608868",
                "_version_": 1595017940265074688
            },
            {
                "stateName_s": "none",
                "userId_s": "yyyy",
                "deviceId_s": "2413",
                "time_s": "2018-3-15T15:26:34.819Z",
                "timestamp_s": "1521127594819",
                "mac_s": "9033215437939420",
                "humidity": "0.98",
                "temperature": "0.0",
                "id": "yyyy-2413-1521127594819",
                "_version_": 1595017908607516673
            },
            {
                "stateName_s": "none",
                "userId_s": "yyyy",
                "deviceId_s": "2413",
                "time_s": "2018-3-15T15:26:20.709Z",
                "timestamp_s": "1521127580709",
                "mac_s": "9033215437939420",
                "humidity": "0.98",
                "temperature": "0.0",
                "id": "yyyy-2413-1521127580709",
                "_version_": 1595017908607516672
            },
            {
                "stateName_s": "none",
                "userId_s": "yyyy",
                "deviceId_s": "2413",
                "time_s": "2018-3-15T15:26:6.630Z",
                "timestamp_s": "1521127566630",
                "mac_s": "9033215437939420",
                "humidity": "0.98",
                "temperature": "0.0",
                "id": "yyyy-2413-1521127566630",
                "_version_": 1595017866398138369
            },
            {
                "stateName_s": "none",
                "userId_s": "yyyy",
                "deviceId_s": "2413",
                "time_s": "2018-3-15T15:25:51.909Z",
                "timestamp_s": "1521127551909",
                "mac_s": "9033215437939420",
                "humidity": "0.98",
                "temperature": "0.0",
                "id": "yyyy-2413-1521127551909",
                "_version_": 1595017866399186944
            }
        ]
    }
}

Get Data by count

URL

https://iot.dialog.lk/expand_iot/solarservice/getDataByCount

Method

POST

Body

{
    "mac_address" : "4483156965705609",
    "eventName" : "statechange",
    "noOfEvents" : 10
}
Last updated on 22nd Apr 2018