* **historicData** – Allows you to retrieve daily historical data for each device (list of values over time, useful for info such as power)
* **realtimeData** – Allows you to retrieve the first/last values of each device (useful for info such as last update, date of first packet sent, energy values…)
* **deviceAlarm** – Allows you to retrieve the current alarm status of each device (useful for knowing the latest alarm status of the inverters, via the date of the last packet received, and the related alarm IDs active at that moment)

Within the requests it will be necessary to insert the "client" field, an identification code will be assigned and communicated by ZCS to each new customer who will make API requests.

Furthermore, all requests must be authenticated, and therefore the 'Authorization' parameter must be present in the headers, with a value equal to 'Zcs eHWAeEq0aYO0'.

The address to which to make POST requests is: https://third.zcsazzurroportal.com:19003/

## 1 Request historicData
The historicData request will have a structure similar to the following:
```json
{
"historicData": {
"command": "historicData",
"params": {
"thingKey": "ZA1ES111H1C029, ZE1ES330M3E696, ZP1ES010L68003, 2612280094",
"requiredValues": "*",
"start": "2021-09-15T00:00:00.000Z",
"end": "2021-09-15T23:59:59.059Z"
}
}
}
```
The "start" and "end" fields will both be MANDATORY and the distance between the 2 values must be max 24 hours. The list of requiredValues available will be the following:
* batteryCycletime
* batterySoC
* powerCharging
* powerDischarging
* powerExporting
* powerImporting
* powerConsuming
* powerAutoconsuming
* powerGenerating
* energyCharging
* energyDischarging
* energyExporting
* energyImporting
* energyConsuming
* energyAutoconsuming
* energyGenerating
* powerDC
* currentDC
* voltageDC
* temperature
* energyChargingTotal
* energyDischargingTotal
* energyExportingTotal
* energyImportingTotal
* energyConsumingTotal
* energyGeneratingTotal

`requiredValues` with value `*` indicates list of all required values

The answer will be like this:
```json
{
"historicData": {
"params": {
"value": [
    {
"ZA1ES111H1C029": {
"powerGenerating": […],
"ts": […],
"energyGenerating": […],
"energyGeneratingTotal": […]}},
{
"ZE1ES330M3E696": {
"powerConsuming": […],
"powerImporting": […],
"energyGenerating": […],
"energyExporting": […],
"ts": […],
"energyAutoconsuming": […],
"energyDischarging": […],
"energyConsuming": […],
"energyImporting": […],
"powerDischarging": […],
"energyCharging": […],
"batterySoC": […],
"powerCharging": […],
"powerGenerating": […],
"powerAutoconsuming": […],
"powerExporting": […],
"batteryCycletime": […],
"energyGeneratingTotal": […],
"energyExportingTotal": […],
"energyDischargingTotal": […],
"energyConsumingTotal": […],
"energyImportingTotal": […],
"energyChargingTotal": […]
}
},
{
"ZP1ES010L68003": {
"powerConsuming": […],
"powerImporting": […],
"energyGenerating": […],
"batterySoC2": […],
"energyExporting": […],
"batteryCycletime2": […]
"ts": […],
"energyAutoconsuming": […],
"energyDischarging": […],
"energyConsuming": […],
"energyImporting": […],
"powerDischarging": […],
"energyCharging": […],
"batterySoC": […],
"powerCharging": […],
"powerGenerating": […],
"powerAutoconsuming": […],
"powerExporting": […],
"batteryCycletime": […],
"energyGeneratingTotal": […],
"energyExportingTotal": […],
"energyDischargingTotal": […],
"energyConsumingTotal": […],
"energyImportingTotal": […],
"energyChargingTotal": […]
}},
{
"2612280094": {
"powerImporting": […],
"energyExporting": […],
"ts": […],
"energyImporting": […],
"powerExporting": […],
}}]
},
"success": true}
}
```
For each type of device, among the values present in requiredValues, there will be only the values of the measurements compatible with the device.

## 2 Real time data

The realtimeData request will have a structure similar to the following:
```json
{
"realtimeData": {
"command": "realtimeData",
"params": {
"thingKey": "ZA1ES111H1C029, ZE1ES330M3E696, ZP1ES010L68003, 2612280094 ",
"requiredValues": "*"
}}}
```
The list of requiredValues available will be the following:
* lastUpdate
* thingFind
* batteryCycletime
* batterySoC
* powerCharging
* powerDischarging
* powerExporting
* powerImporting
* powerConsuming
* powerAutoconsuming
* powerGenerating
* energyCharging
* energyDischarging
* energyExporting
* energyImporting
* energyConsuming
* energyAutoconsuming
* energyGenerating
* energyChargingTotal
* energyDischargingTotal
* energyExportingTotal
* energyImportingTotal
* energyConsumingTotal
* energyAutoconsumingTotal
* energyGeneratingTotal
* `*` (INDICATES LIST OF ALL PREVIOUS VALUES)

The answer will be like this:

```json
{
"realtimeData": {
"params": {
"value": [
{
"ZA1ES111H1C029": {
"powerGenerating": 490,
"energyGenerating": 0.8,
"energyGeneratingTotal": 3874,
"thingFind": "2019-02-01T08:51:48Z",
"lastUpdate": "2022-01-10T09:53:13Z"
}
},
{
"ZE1ES330M3E696": {
"powerConsuming": 800,
"thingFind": "2021-04-29T12:23:20Z",
"energyAutoconsuming": 0.57,
"energyAutoconsumingTotal": 1942,
"batteryCycletime": 161,
"energyImportingTotal": 2053,
"energyCharging": 0,
"energyGeneratingTotal": 3572,
"energyExportingTotal": 814,
"energyChargingTotal": 816,
"powerAutoconsuming": 570,
"lastUpdate": "2022-01-10T09:44:11Z",
"powerExporting": 0,
"powerGenerating": 570,
"energyImporting": 4.7,
"powerImporting": 230,
"energyGenerating": 0.57,
"energyDischargingTotal": 769,
"energyDischarging": 0.12,
"energyConsuming": 5.39,
"energyExporting": 0,
"energyConsumingTotal": 4764,
"batterySoC": 17,
"powerCharging": 0,
"powerDischarging": 0
}
},
{
"ZP1ES010L68003": {
"powerConsuming": 4171,
"thingFind": "2020-11-04T08:42:51Z",
"energyAutoconsuming": 10.54,
"energyAutoconsumingTotal": 16371.8,
"batteryCycletime": 0,
"energyImportingTotal": 0,
"energyCharging": 0,
"energyGeneratingTotal": 16371.8,
"energyExportingTotal": 0,
"batterySoC2": 0,
"powerAutoconsuming": 4171,
"lastUpdate": "2022-01-10T09:49:43Z",
"powerExporting": 0,
"powerGenerating": 4171,
"energyImporting": 0,
"powerImporting": 0,
"energyGenerating": 10.54,
"batteryCycletime2": 0,
"energyDischargingTotal": 0,
"energyDischarging": 0,
"energyConsuming": 10.54,
"energyExporting": 0,
"energyConsumingTotal": 16371.8,
"batterySoC": 0,
"powerCharging": 0,
"powerDischarging": 0,
"energyChargingTotal": 0
}
},
{
"2612280094": {
"energyExporting": 3601.65,
"powerImporting": 0,
"thingFind": "2021-02-23T15:10:39Z",
"energyImporting": 2.01,
"energyImportingTotal": 2.01,
"powerExporting": 171,
"energyExportingTotal": 3601.65,
"lastUpdate": "2022-01-10T09:49:31Z"
}
}
]
},
"success": true
}
}
```
For each type of device, among the values present in requiredValues, there will be only the values of the measurements compatible with the device.

## Device alarm

The deviceAlarm request will look like this:
```json
{
"deviceAlarm": {
"command": "deviceAlarm",
"params": {
"thingKey": "ZA1ES122JAH761, ZE1ES330M3E696, ZP1ES010L68003, 2612280094",
"requiredValues": "*"
}
}
}
```
The list of requiredValues available will be the following:
* lastUpdate
* deviceAlarm
* `*` (INDICATES LIST OF ALL PREVIOUS VALUES)
The answer will be like this:
{
" deviceAlarm": {
"params": {
"value": [
{
"ZA1ES122JAH761": {
    "deviceAlarm": [
2,
4
],
"lastUpdate": "2022-10-24T09:32:49Z"
}
},
{
"ZE1ES330M3E696": {
"deviceAlarm": [],
"lastUpdate": "2022-10-24T09:46:03Z"
}
},
{
"ZP1ES010L68003": {
"deviceAlarm": [],
"lastUpdate": "2022-02-28T08:27:56Z"
}
},
{
"2612280094": {}
}
]
},
"success": true
}}
For each type of device, among the values present in requiredValues, there will be only the values of the measurements compatible with the device.
```
