Get history data of sensor
http://www.lewei50.com/api/v1/sensor/GetHistoryData/{sensor ID}
Yes
Required | Default Value | Type | Range | Description | |
---|---|---|---|---|---|
StartTime | No | 2000-01-01 | datetime | < Now | Start time |
EndTime | No | 当前时间 | datetime | End time | |
Interval | No | 1 | int | <1 | Interval |
Start | No | 0 | int | Start | |
Limit | No | 1000 | int | 1-1000 | Take the number of data at a time |
Order | No | 1 | int | 0 or 1 | 0:desc 1:asc |
get
json
{ "Data": [ { "updateTime": "2012-08-22T21:15:18", "value": 22 }, { "updateTime": "2012-08-22T22:11:28", "value": 22 }, { "updateTime": "2012-08-23T10:51:31", "value": 22 } ], "Successful": true, "Message": null }
Type | Description | |
---|---|---|
Successful | boolean | Successful |
Message | string | Message if error |
Data/updateTime | string | Update time |
Data/value | string | Value |
Sensor for the global identifier ID, not idName;
The time format is: ISO 8601.
Paging:
If one did not take all the data, use the Start parameter to obtain the next page of data, such as Start 1000, will be over 1000 have taken data, return 1001-2000 data.
About sorting:
If you need to access data in reverse chronological order, such as the nearest 1000 data, need to pass Order=0.