access_via_api
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
access_via_api [2019/06/07 14:27] – [Getting current registers values] akuzmuk | access_via_api [2020/04/07 10:08] – [Getting register log] emozolyak | ||
---|---|---|---|
Line 624: | Line 624: | ||
To obtain entries from the register register, you must perform follwing GET request on a URL http:// | To obtain entries from the register register, you must perform follwing GET request on a URL http:// | ||
- | In the request headers, it is necessary to pass the API key, the boundaries of the time interval of interest, and a list of register identifiers. X-WH-START and X-WH-END are transmitted in UnixTime format. The register ID is passed by a comma-separated list in the X-WH-REG-IDS | + | In the request headers, it is necessary to pass the API key, the boundaries of the time interval of interest, and a list of register identifiers. X-WH-START and X-WH-END are transmitted in UnixTime format. The register ID is passed by a comma-separated list in the X-WH-REGISTERS |
X-WH-APIKEY: | X-WH-APIKEY: | ||
X-WH-START: 1422595501 | X-WH-START: 1422595501 | ||
X-WH-END: 1422599101 | X-WH-END: 1422599101 | ||
- | X-WH-REG-IDS: 8,10 | + | X-WH-REGISTERS: 8,10 |
| | ||
Also, in the headers, you must specify the desired data exchange format. Currently, only the JSONformat is supported. | Also, in the headers, you must specify the desired data exchange format. Currently, only the JSONformat is supported. | ||
Line 648: | Line 648: | ||
X-WH-START: 1422595501 | X-WH-START: 1422595501 | ||
X-WH-END: 1422599101 | X-WH-END: 1422599101 | ||
- | X-WH-REG-IDS: 8,10 | + | X-WH-REGISTERS: 8,10 |
Reply example: | Reply example: | ||
Line 874: | Line 874: | ||
| 3|Alert | | | 3|Alert | | ||
| '' | | '' | ||
+ | |||
+ | ===== Getting meters log ===== | ||
+ | |||
+ | To obtain entries from the register register, you must perform follwing GET request on a URL http:// | ||
+ | |||
+ | In the request headers, it is necessary to pass the API key, the boundaries of the time interval of interest, and a list of register identifiers. X-WH-START and X-WH-END are transmitted in UnixTime format. The register ID is passed by a comma-separated list in the X-WH-REGISTERS header. For example: | ||
+ | |||
+ | X-WH-APIKEY: | ||
+ | X-WH-START: 1422595501 | ||
+ | X-WH-END: 1422599101 | ||
+ | X-WH-REGISTERS: | ||
+ | | ||
+ | Also, in the headers, you must specify the desired data exchange format. Currently, only the JSON format is supported. | ||
+ | |||
+ | Accept: application/ | ||
+ | Content-Type: | ||
+ | |||
+ | Example of querying records from the meters log: | ||
+ | |||
+ | ***URL**: http:// | ||
+ | ***Method**: | ||
+ | *Header: | ||
+ | |||
+ | Accept: application/ | ||
+ | Content-Type: | ||
+ | Accept-Encoding: | ||
+ | X-WH-APIKEY: | ||
+ | X-WH-START: 1422595501 | ||
+ | X-WH-END: 1422599101 | ||
+ | X-WH-REGISTERS: | ||
+ | |||
+ | Reply example: | ||
+ | |||
+ | < | ||
+ | { | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | и т.д. | ||
+ | ] | ||
+ | </ | ||
+ | |||
+ | Returns the array, where the index is time in UnixTime format. Elements of the array have another array of objects. | ||
+ | Each object has three properties: r, v, s. | ||
+ | |||
+ | ^r|is the register ID. For example, 10 | | ||
+ | ^v|is the value of the register at the specified time point or an empty string if there is no data for this register at this time. | | ||
+ | ^s|is the state of the register that matched it at the specified time: | | ||
+ | | -1|Unknown | | ||
+ | | 0|Disabled | | ||
+ | | 1|Normal | | ||
+ | | 2|Warning | | ||
+ | | 3|Alert | | ||
+ | | '' | ||
+ | |||
===== Getting current registers values ===== | ===== Getting current registers values ===== | ||
Line 1300: | Line 1556: | ||
To get data from graph log, it is necessary to run following GET-query for URL http:// | To get data from graph log, it is necessary to run following GET-query for URL http:// | ||
- | Also, instead of specifying the graph ID, you can send the X-WH-REGS header. It specifies, through the comma, the ID of the registers for which data is to be extracted. Example: | + | Also, instead of specifying the graph ID, you can send the X-WH-REGISTERS |
- | X-WH-REGS: 23,12,4 | + | X-WH-REGISTERS: 23,12,4 |
In the request headers, you must pass the API key, the boundaries of the time interval of interest (X-WH-START, | In the request headers, you must pass the API key, the boundaries of the time interval of interest (X-WH-START, |
access_via_api.txt · Last modified: 2023/03/02 10:53 by emozolyak