Query device status report log

Last Updated on : 2023-07-06 07:19:19download

Query device status report log

API address

GET: /v1.0/iot-03/devices/{device_id}/report-logs

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueDevice ID
codesStringquerytrueThe function points supported by the device. It supports multiple function points query, separated by a comma (,), the default is empty
start_timeLongquerytrueThe start timestamp of the query, 13 digits
end_timeLongquerytrueThe end timestamp of the query, 13 digits
sizeIntegerqueryfalseThe size of the number of logs to be queried (the default is 20)
last_row_keyStringqueryfalsePagination parameter, last_row_key in the return value of the previous page request, query the first page when the passed parameter is empty

Return parameter

Parameter nameTypeDescription
resultDeviceLogRes

Description of result

Parameter nameTypeDescription
last_row_keyStringThe identifier of the current page, which can be used as the lastRowKey parameter value of the next page query
device_idStringDevice id
has_moreBooleanIs there a next page
totalLongTotal number of eligible data
listListData List

Description of list

Parameter nameTypeDescription
codeStringStatus Code
valueObjectStatus Value
event_timeLongEvent Time

Request example

GET: /v1.0/iot-03/devices/xxxid/report-logs?last_row_key=xxx&codes=xxx&start_time=1545898159931&end_time=1545898159935&size=20

Return example

{
    "result": {
        "last_row_key": "89C8D4D5F7E17A03F1A338xxxx",
        "device_id": "xxxxx",
        "total": 2,
        "has_more": false,
        "logs": [
            {
                "code": "switch_1",
                "value": "false",
                "event_time": 1560872567955
            }
        ]
    },
    "t": 1561344464370,
    "success": true
}

Error code

For more information, see error code.