FluentaAPI
Analytics

Get station events

getStationEventsPermission read

One puesto’s marcas of a day, summarised from the marcas log: units, billing, online and offline marcas, pace and «pausas sin registro».

GET/v1/external/organizations/{organizationId}/stations/{stationId}/analytics/events

What it is: one «puesto»’s «marcas» of one plant day in a single summary (events), as «Analítica» reads them in the dashboard («Reportes», tab «Analítica»): how many «marcas» and units, how many of them billable and for how much, how they arrived (live, queued offline, or from an app too old to send a time), the seconds between consecutive «marcas» (median and 90th percentile), how many gaps longer than idleMinutes minutes there were («pausas sin registro»: gaps inferred from the log, not the «pausas» an «operario» takes with «Pausar»), and the first and last «marca».

Source: «Analítica» reads the «marcas» log (one row per unit an «operario» registered on the app, with its time and channel) beside the hourly buckets the reports are built from, so it can tell pace, connectivity and gaps that the reports cannot.

Money is «Facturación»: the units of the «puestos de salida» × the price per unit each was billed at, in the plant’s currency (currency, ISO 4217: EUR for a plant in España, COP for every other), in whole currency units with up to 2 decimals, never cents. Whether a money figure reads null or 0 where nothing was priced is stated on each field.

Days and hours are the plant’s own: a plant day is a calendar day YYYY-MM-DD in the organization’s timezone (getOrganization timezone), never UTC, and an hour is the clock hour 0–23 that starts at it in that zone. day is optional: without it, the plant’s today on the organization’s own clock, as on every single-day route of the API externa; the answer’s day says which day was read. firstAt and lastAt are instants, ISO 8601 in UTC.

Naming: a «puesto» (a numbered station of a «módulo») is a station in paths and an operation in ids, filters and codes. A path’s stationId is the same number as the operationId of answers and of filters and as the id listStations returns, and one that is not this organization’s answers 404 OPERATION_NOT_FOUND.

Plan: needs the plan feature analytics («Analítica»), the one its dashboard screen is gated by. Pro, a trial of Pro and an «exenta» organization answer it; a Light organization, of either plan version, does not: 403 PLAN_LIMIT with feature: "analytics". getPlan features lists what the organization’s plan has.

See also: getStationDayReport for the same «puesto» and day as its report (hours, «meta», «Eficiencia»); getStationActivity with view=events is this same summary under the first release’s route.

Authorization

apiToken
AuthorizationBearer <token>

An API token created in Configuración › Tokens de API, or a connected app’s access token

In: header

Path Parameters

stationId*integer

The «puesto»: the id of a station from listStations. The same number is called operationId in answers and in filters; unknown or of another organization: 404 OPERATION_NOT_FOUND.

organizationId*integer

The organization, from getMe or listOrganizations.

Query Parameters

day?string

The plant day to read, YYYY-MM-DD on the plant’s own clock (the organization’s timezone, never UTC). Omitted: the plant’s today on that clock; the answer’s day says which day was read. Not a real calendar day: 400 INVALID_DAY.

Match^\d{4}-\d{2}-\d{2}$
Lengthlength <= 10
idleMinutes?number

In minutes: a gap between two consecutive «marcas» longer than this counts as one «pausa sin registro» (idleGapsOverN, idleGaps). One of 5, 10 or 15; default 5. The answer echoes the value used.

Value in

  • 5
  • 10
  • 15

Response Body

application/json

application/json

curl -X GET "https://api.fluenta.io/v1/external/organizations/0/stations/0/analytics/events" \  -H "Authorization: Bearer fluenta_live_XXXX"
{  "day": "string",  "operationId": 0,  "currency": "string",  "events": {    "events": 0,    "units": 0,    "billableUnits": 0,    "billedAmount": 0,    "online": 0,    "offline": 0,    "legacy": 0,    "eventsWithoutBucket": 0,    "secondsPerUnitP50": 0,    "secondsPerUnitP90": 0,    "idleGapsOverN": 0,    "idleMinutes": 0,    "firstAt": "2019-08-24T14:15:22Z",    "lastAt": "2019-08-24T14:15:22Z"  }}