Events count - Fluid Topics - Latest

Fluid Topics API Reference Guide

Category
Reference Guides
Audience
public
Version
Latest

This web service responds with the number of events logged during a selected period.

Method Endpoint
POST
/analytics/api/v1/traffic/event-counts

It is necessary to provide an Ft-Calling-App value when using Fluid Topics web services. See Fluid Topics calling app.

Request example

The following example shows a JSON request body for this web service:

{
  "startDate": "2024-01-01",
  "endDate": "2024-05-01",
  "groupByPeriod": "month",
  "filters": {
    "name": [
      "khub.search",
      "feedback.send"
    ]
  }
}
Field Type Required? Description
startDate String Yes The inclusive start date of the period. Its format can be YYYY-MM-DD, YYYY-MM-DDTHH:MM or YYYY-MM-DDTHH:MM:SS. For more information about date and time formats, see Timestamps.
The value must be within the analytics data retention period.
endDate String Yes The exclusive end date of the period. Must be later than the startDate. Its format can be YYYY-MM-DD, YYYY-MM-DDTHH:MM or YYYY-MM-DDTHH:MM:SS. For more information about date and time formats, see Timestamps.
The value must be within the analytics data retention period.
groupByPeriod String Yes The period by which to group the events. Valid values are month, week, and day.
filters Object No An object to specify which events to retrieve. If this field is absent or undefined, the web service returns data for all events.
name Array No An array containing the names of the events to retrieve. Valid values are listed here. If undefined, the web service returns data for all events.

Response body

The following example shows a JSON response body for this web service:

{
  "startDate": "2024-01-01",
  "endDate": "2024-05-01",
  "results": [
    {
      "name": "khub.search",
      "periods": [
        {
          "periodStartDate": "2024-01-01",
          "periodEndDate": "2024-02-01",
          "eventCount": 4395
        },
        {
          "periodStartDate": "2024-02-01",
          "periodEndDate": "2024-03-01",
          "eventCount": 3988
        },
        {
          "periodStartDate": "2024-03-01",
          "periodEndDate": "2024-04-01",
          "eventCount": 4414
        },
        {
          "periodStartDate": "2024-04-01",
          "periodEndDate": "2024-05-01",
          "eventCount": 4071
        }
      ]
    },
    {
      "name": "feedback.send",
      "periods": [
        {
          "periodStartDate": "2024-01-01",
          "periodEndDate": "2024-02-01",
          "eventCount": 58
        },
        {
          "periodStartDate": "2024-02-01",
          "periodEndDate": "2024-03-01",
          "eventCount": 60
        },
        {
          "periodStartDate": "2024-03-01",
          "periodEndDate": "2024-04-01",
          "eventCount": 101
        },
        {
          "periodStartDate": "2024-04-01",
          "periodEndDate": "2024-05-01",
          "eventCount": 38
        }
      ]
    }
  ]
}
Field Type Description
startDate String The inclusive start date of the period.
endDate String The exclusive end date of the period.
groupByPeriod String The period by which results are grouped.
results Array An array containing the results.
name String The name of the event.
periods Array An array containing data for the requested periods.
periodStartDate String The inclusive start date of the period.
periodEndDate String The exclusive end date of the period.
eventCount Number The number of events logged during the period.
Return code Description
200 OK Returns 0 or more results.