Statistics

Get login statistics

Filtering

Filters can be applied to limit the results that are returned. Filters are applied using the "filter" query parameter. Available filters are:

date (eq, lt, lte, gt, gte)

user (eq)

Example:

{
    "filter": {
        "date": {
            "gte": "2010-04-01",
            "lt": "2010-04-30"
        },
        "user": {
            "eq": 1234
        },
    }
}

The date filter accepts Y-m-d and ISO-8601. Statistics are aggregated per day, so an ISO-8601 value carrying a UTC designator or a UTC offset is converted to the application timezone and reduced to its date.

get/statistics/logins

Request

Query parameters

Search filters to be applied

{
  "filter": {
    "date": {
      "gte": "2010-04-01",
      "lt": "2010-04-30"
    },
    "user": {
      "eq": 1234
    }
  }
}

Pagination

{
  "page": {
    "number": 1,
    "size": 30
  }
}
sort'date' | '-date' | 'user_name' | '-user_name' | 'organization' | '-organization' | 'ip_address' | '-ip_address' | 'activity_source' | '-activity_source'

Sorting options { field_name } or { -field_name } for descending order

Response

success

Example response

{
  "data": [
    {
      "type": "login_statistic",
      "id": "1234",
      "attributes": {
        "date": "2024-01-31 09:55:41",
        "action": "user_login",
        "user_name": "Luca Brasi",
        "user_id": "220",
        "organization": "Corleone Group",
        "ip_address": "127.0.0.1",
        "activity_source": "api"
      }
    }
  ],
  "links": {
    "self": "https://example.kontainer.com/jsonapi/v2/statistics/logins?page%5Bnumber%5D=2",
    "first": "https://example.kontainer.com/jsonapi/v2/statistics/logins?page%5Bnumber%5D=1",
    "last": "https://example.kontainer.com/jsonapi/v2/statistics/logins?page%5Bnumber%5D=30",
    "prev": "https://example.kontainer.com/jsonapi/v2/statistics/logins?page%5Bnumber%5D=1",
    "next": "https://example.kontainer.com/jsonapi/v2/statistics/logins?page%5Bnumber%5D=3"
  },
  "meta": {
    "total": 870,
    "count": 30,
    "per_page": 30,
    "current_page": 2,
    "total_pages": 29,
    "sort": "-date"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.