FluentaAPI
Analytics

Get consistency

getConsistencyPermission read

The marcas log against the hourly buckets for one plant day: which puesto-hours agree, which differ, and by how many units.

GET/v1/external/organizations/{organizationId}/analytics/consistency

What it is: a data-quality check, the consistency view of the dashboard’s «Reportes», tab «Analítica». Every unit is stored twice: once as a «marca» in the log and once added into the hourly bucket of its «puesto», hour and «referencia», which is what the reports read. rows holds one entry per «puesto», hour and «referencia» of the plant day with the units each side holds (eventUnits, bucketTotal) and a status; totals counts the rows of each status and adds up both sides.

How to read status: ok, both sides hold the same units; mismatch, both exist and differ; bucket_only, the reports hold units the log does not (expected for days before the log existed); events_only, the log holds «marcas» no bucket received. A day that is all ok means the reports can be trusted to the unit. It is not a production figure: use getHourlyActivity or the reports for that.

Naming: each row’s operationId is its «puesto» (a numbered station of a «módulo»). A «puesto» is an operation in ids, filters and codes and a station in paths: the same number is the id listStations returns and the stationId of the station routes.

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. moduleId narrows the check to one «módulo» and is echoed, null when not sent.

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.

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

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
moduleId?integer

Narrow the answer to one «módulo»: the id of one from listModules. Omitted: the whole plant. Of another organization or unknown: 404 MODULE_NOT_FOUND.

Range1 <= value <= 2147483647

Response Body

application/json

application/json

curl -X GET "https://api.fluenta.io/v1/external/organizations/0/analytics/consistency" \  -H "Authorization: Bearer fluenta_live_XXXX"
{  "totals": {    "ok": 0,    "mismatch": 0,    "bucketOnly": 0,    "eventsOnly": 0,    "eventUnits": 0,    "bucketUnits": 0,    "online": 0,    "offline": 0,    "legacy": 0,    "eventsWithoutBucket": 0  },  "rows": [    {      "operationId": 0,      "hour": 0,      "referenceId": 0,      "isBilling": true,      "eventUnits": 0,      "bucketTotal": 0,      "status": "ok",      "moduleId": 0,      "modulePosition": 0,      "operationPosition": 0,      "operationName": "string",      "referenceName": "string"    }  ],  "day": "string",  "moduleId": 0}