Get Historical Data
Description
This interface allows users to retrieve historical data. (There is a frequency limit; each IP should not exceed 5 times per second. If exceeded, the IP may be blocked by the NG proxy.)
Request Address
URL:
[Host Server]/hs/v2/hdata/get
Address Parameter Description
Field Type Description Host Server string See Explanation of terms Method
POST
Header
Field Type Description Authorization string "Bearer " + Access_token obtained in login interface Body
Field Type Description type int 0: By row (time1: data for entry 1, data for entry 2, time2: data for entry 1, data for entry 2,...) format int 0: JSON, 1: CSV file ids Array List of channel IDs under historical entries names Array Historical entry names (only used for header in export function) g int 0: Raw data, 1: Segmented data, 2: Hourly data, 3: Daily data begin dateTime Start time (JavaScript timestamp, milliseconds since 1970-1-1) end dateTime End time (same as above) tr int Time condition boundary type (0: left open right open, 1: left open right closed, 2: left closed right open, 3: left closed right closed. Left indicates start time, right indicates end time) limit int Maximum number of data points to retrieve. Negative value indicates retrieving limit points from end time to start time. The result will display in ascending order . Maximum limit is 1000, recommended is 500 tz string Linux time zone string (eg., Asia/Shanghai), specifying the time zone of imported CSV Successful Response
Note
t represents the Linux epoch time, c is the array of returned data, which corresponds to the channels 1, 2, 3, 4, 5, 6, 7... in order of the channels that user sent.Response Codes
Code Description 200 Successful execution 401 Access token expired 400 Error message in the HTTP Header [X-FBox-Code],see Appendix Three for details 404 Interface does not exist, please check the URL 429 Access to the interface so frequently ,see 429 Statues code Postman example is as follows:
- Please see the example in the following image.