#TenantController

# Overview

# Description

Path /v2/statistics

Provides statistic information about different parts in roomle

To retrieve tenant statistics (subpath tenants/:id/) the user needs TENANT_STATISTICS rights within this tenant.

# API Reference

# GET tenants/:id/useractions/

Generates: application/json , text/csv

returns the monthly-aggregated useractions within this tenant. possible filters:

  • module
  • action (only allowed with module filter is also present)

sample results:

{
    "userActions":[
    {
    "date":"2014-12-31T23:00:00.000Z",
    "module":4,
    "action":1,
    "tenant":2,
    "count":2,
    "aggregationLevel":2}
    ,...
    ]
}
"module","action","tenant","count","month","year",
4,1,2,2,1,2015
4,1,2,1,4,2015
4,1,2,46,5,2015

please note that the date is the date of the first userAction that appeared within the aggregation period (in this case months)

# GET tenants/:id/userActionsAggregated

Generates: application/json

Returns the aggregated UserActions in the list for the specified tenant, module and actions in the time frame (from-to) If the time frame is incomplete/absent, the current month is returned If aggregations[] are posted, the results are additionaly aggregated by the posted parameters as well

path-param:

  • id (Long): the tenantId query-param:
  • module (Integer): id of the requested Module
  • actions[] (List of Integer): List of integers of the Actions
  • from (String): has to be a date string with timezone. This string has to match following example 2016-06-01T07:54:07.000Z.
  • to (String): has to be a date string with timezone. This string has to match following example 2016-06-01T07:54:07.000Z.
  • aggregations[] (List of String) : List of parameters by which the UserActions are additionaly aggregated - More info

# aggregations[]

The list can contain only specific strings, which equal columns in the DB. These are:

  • country
  • device
  • actionLabel - it is used by the configurator for storing the configuratorId
  • actionId - it is used by the configurator to store the item/configuration ID Any other strings will be rejected with a 400 error

sample results:

{
  "userActions": [
    {
      "module": 4,
      "action": 1,
      "tenant": 2,
      "count": 49,
      "aggregationLevel": 0
    },
    {
      "module": 4,
      "action": 3,
      "tenant": 2,
      "count": 2,
      "aggregationLevel": 0
    }
  ],
  "meta": {
    "total": 2,
    "serverTime": "2021-04-15T08:55:20.421Z"
  }