qnap-dev / qnap-qiot-sdks

QNAP QIoT - quickly structure your IoT environment and deployment
http://qiot.qnap.com
113 stars 39 forks source link

QHistoricData ignores startTime endtime #9

Open K0ertis opened 5 years ago

K0ertis commented 5 years ago

Example uses in info:

`var start_date = new Date(); start_date.setHours(start_date.getHours() - 2);

var msg = { payload: { start_date: start_date, end_date: new Date() } };

API has different variable names for start_date and end_date

Which one is the correct syntax? I don't get the valid data range from either commands: start_data & end_date or enddatetime & startdatetime

Se quote afterwards

resObjectId string (required) Example: 5a005cba9c31dc00246d1fb6

Unique ResourceID of QIoT Device.

startdatetime string (required) Example: 2017-01-01T16:05:00

Format = Standard ISO datetime format precision upto seconds. Example - YYYY-MM-DDTHH:MM:SS. **No Millisecond in date. Date must be UTC date. Start datetime of the historic data API.

enddatetime string (required) Example: 2017-01-01T16:50:00

Format = Standard ISO datetime format precision upto seconds. Example - YYYY-MM-DDTHH:MM:SS. **No Millisecond in date. Date must be UTC date. enddatetime must be greater than startdatetime. QIoT supports historic data for maximum 1 days date range for ARM models. MAXIMUM Range: 1 day

page string (optional) Default: 1 Example: 1

Pagination (page size = 20) Positive Integer

limit integer (optional) Default: 500Maximum: 1000 Example: 25

Maximum number of records per page.

key string (required) Example: j9pf68gz000b1381149cni4o

API key access the historic API. User can generate the API key to access the historic data API from QIoT interface.

And how can I show the data in a line chart, which format is the linechart exacting, it's seems it differ from the node-red line-chart