Last Updated on : 2024-08-15 06:14:24download
Based on the device ID, get the logs that the device status is reported.
GET: /v2.1/cloud/thing/{device_id}/report-logs
Parameter name | Type | IN | Required | Description |
---|---|---|---|---|
device_id | String | path | true | The device ID. |
codes | String | query | true | The codes of data points supported by the device. You can query multiple data points, separated with commas (,). This parameter value is empty by default. |
start_time | Long | query | true | The timestamp of the start time for a query. |
end_time | Long | query | true | The timestamp of the end time for a query. |
last_row_key | String | query | false | The row key of the last entry on each page. The default value is empty, which means the first page. |
size | Integer | query | true | The number of logs allowed to be returned. Default value: 20 . Recommended value: less than 100 . |
Parameter name | Type | Description |
---|---|---|
last_row_key | String | The identifier of the current page. It can be used as the lastRowKey parameter value to query the next page. |
device_id | String | The device ID. |
has_more | Boolean | Specifies whether to return the next page. |
total | Long | The total entries of data that meets the criteria. |
logs | List | The list of logs. |
Description of logs
Parameter name | Type | Description |
---|---|---|
code | String | The code of the specified event. |
value | Object | The status value. |
event_time | Long | The time when an event occurred. |
GET: /v2.1/cloud/thing/{{device_id}}/report-logs?codes=switch_led_1&start_time=1676944806000&end_time=1677141431000&last_row_key=&size=20
{
"tid": "939b81a5b3eb11ed887edada9ae0bcf6",
"result": {
"device_id": "vdevo167115422036***",
"total": 1000,
"has_more": false,
"logs": [
{
"code": "switch_led_1",
"value": "true",
"event_time": 1677141419268
},
{
"code": "switch_led_1",
"value": "false",
"event_time": 1677141418601
},
{
"code": "switch_led_1",
"value": "true",
"event_time": 1677141398699
}
]
},
"t": 1677205989547,
"success": true
}
For more information, see error code.
For more information, see Limits on API Request Frequency.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback