GET /api/external/v1/statistics/bykey/{key}/{periodStart}/{periodEnd}/groupbyusage

Get monthly statistics data for certain item in the structure and period grouped by usage type. If there are multiple media types in the result set with different units, the result set will also be grouped by media type unit.

Request Information

Permissions

The user must be authorized and must have at least one of these operations to access this api method.

Operation (significant name)Description
Access external API (acc_extapi) Gives the user access to the external API.

Embeded Resource Parameters

None

URI Parameters

NameDescriptionTypeAdditional information
key

Identifier of the item to get statistics data for.

string

Required

periodStart

Starting year and month to get statistics for. Valid format is YYYY-MM-DD. Dates are obliged as statistics data are summed up per month.

date

Required

periodEnd

Ending year and month to get statistics for. Valid format is YYYY-MM-DD. Dates are obliged as statistics data are summed up per month.

date

Required

Body Parameters

None.

Response Information

Resource Description

A list with all statistics data if any, otherwise empty list

DataResultOfUGStatisticsDto
NameDescriptionTypeAdditional information
Data

Collection of UGStatisticsDto

None.

Total

integer

None.

Take

integer

None.

Skip

integer

None.

Response Formats

application/json, text/json

Sample:
{
  "data": [
    {
      "itemKey": "sample string 1",
      "usageType": "sample string 2",
      "mediaClass": "sample string 3",
      "mediaType": "sample string 4",
      "startDate": "2024-04-18T21:40:54.9699073+02:00",
      "stopDate": "2024-04-18T21:40:54.9699073+02:00",
      "consumptionUnit": "sample string 7",
      "consumption": 1.1,
      "consumptionNormalized": 1.1,
      "energyUnit": "sample string 8",
      "energy": 1.1,
      "energyNormalized": 1.1,
      "lastUpdated": "2024-04-18T21:40:54.9699073+02:00"
    },
    {
      "itemKey": "sample string 1",
      "usageType": "sample string 2",
      "mediaClass": "sample string 3",
      "mediaType": "sample string 4",
      "startDate": "2024-04-18T21:40:54.9699073+02:00",
      "stopDate": "2024-04-18T21:40:54.9699073+02:00",
      "consumptionUnit": "sample string 7",
      "consumption": 1.1,
      "consumptionNormalized": 1.1,
      "energyUnit": "sample string 8",
      "energy": 1.1,
      "energyNormalized": 1.1,
      "lastUpdated": "2024-04-18T21:40:54.9699073+02:00"
    }
  ],
  "total": 1,
  "take": 2,
  "skip": 3
}