Desarrolladores / Referencia / Reportes

Reportes

10 operaciones de solo lectura. Observaciones de campo, sus categorías, mediciones y fotos.

Reportes

Observaciones de campo, sus categorías, mediciones y fotos.

GET

/reportsListar reportes

Observaciones de campo (estado vital, fenología, daños, plagas, medidas…), paginadas. Filtra por planta con fi.subjectId_eq.

Tipo
Lista paginada
Permiso
reports:read
Parámetros
pageNumberconsulta · enteroPágina, desde 1.
pageSizeconsulta · enteroRegistros por página. Con llave, máximo 100.
Filtros · fi.<campo>_<operador>=valor
subjectIdreporterIdparentIdcreatedAtcreatedFromcreatedTo
Relaciones (includes) · in.<relación>=true
childrenimagesmainCategorymeasurementparentsubcategory
Respuesta 200 · application/json · ejemplo
{
  "data": [
    {
      "id": 40,
      "mainCategoryId": 7,
      "subcategoryId": 52,
      "subjectId": 12,
      "reporterId": 9,
      "description": "Floración inicial",
      "parentId": null,
      "replyKind": null,
      "createdAt": "2026-08-21T17:04:11.000Z",
      "updatedAt": "2026-09-28T19:40:02.000Z",
      "deletedAt": null,
      "enabled": true
    }
  ],
  "pagination": {
    "pageNumber": 1,
    "pageSize": 25,
    "totalCount": 25,
    "totalPages": 1,
    "hasNextPage": false,
    "hasPreviousPage": false
  }
}
curl
curl -H "Authorization: Bearer $CUFLORA_KEY" \
  "https://cuflora.kawi.page/reports?pageSize=100"
Python
import os, requests

r = requests.get("https://cuflora.kawi.page/reports?pageSize=100",
                 headers={"Authorization": f"Bearer {os.environ['CUFLORA_KEY']}"})
r.raise_for_status()
datos = r.json()
JavaScript
const r = await fetch("https://cuflora.kawi.page/reports?pageSize=100", {
  headers: { Authorization: `Bearer ${process.env.CUFLORA_KEY}` },
});
if (!r.ok) throw new Error(`HTTP ${r.status}`);
const datos = await r.json();
GET

/report-imagesListar fotos de reportes

Qué imagen va con qué reporte. La imagen se descarga con GET /images/{id}.

Tipo
Lista paginada
Permiso
report-images:read
Parámetros
pageNumberconsulta · enteroPágina, desde 1.
pageSizeconsulta · enteroRegistros por página. Con llave, máximo 100.
Respuesta 200 · application/json · ejemplo
{
  "data": [
    {
      "id": 5,
      "reportId": 40,
      "imageId": 31,
      "createdAt": "2026-08-21T17:04:11.000Z",
      "updatedAt": "2026-09-28T19:40:02.000Z",
      "deletedAt": null,
      "enabled": true
    }
  ],
  "pagination": {
    "pageNumber": 1,
    "pageSize": 25,
    "totalCount": 25,
    "totalPages": 1,
    "hasNextPage": false,
    "hasPreviousPage": false
  }
}
curl
curl -H "Authorization: Bearer $CUFLORA_KEY" \
  "https://cuflora.kawi.page/report-images?pageSize=100"
Python
import os, requests

r = requests.get("https://cuflora.kawi.page/report-images?pageSize=100",
                 headers={"Authorization": f"Bearer {os.environ['CUFLORA_KEY']}"})
r.raise_for_status()
datos = r.json()
JavaScript
const r = await fetch("https://cuflora.kawi.page/report-images?pageSize=100", {
  headers: { Authorization: `Bearer ${process.env.CUFLORA_KEY}` },
});
if (!r.ok) throw new Error(`HTTP ${r.status}`);
const datos = await r.json();
GET

/report-categoriesListar categorías de reporte

Las 8 categorías raíz y sus subtipos. Un subtipo tiene parentId; los de medidas traen defaultUnit.

Tipo
Lista paginada
Permiso
report-categories:read
Parámetros
pageNumberconsulta · enteroPágina, desde 1.
pageSizeconsulta · enteroRegistros por página. Con llave, máximo 100.
Filtros · fi.<campo>_<operador>=valor
parent
Relaciones (includes) · in.<relación>=true
parentsubcategories
Respuesta 200 · application/json · ejemplo
{
  "data": [
    {
      "id": 7,
      "name": "Medidas",
      "description": null,
      "parentId": null,
      "defaultUnit": null,
      "createdAt": "2026-08-21T17:04:11.000Z",
      "updatedAt": "2026-09-28T19:40:02.000Z",
      "deletedAt": null,
      "enabled": true
    }
  ],
  "pagination": {
    "pageNumber": 1,
    "pageSize": 25,
    "totalCount": 25,
    "totalPages": 1,
    "hasNextPage": false,
    "hasPreviousPage": false
  }
}
curl
curl -H "Authorization: Bearer $CUFLORA_KEY" \
  "https://cuflora.kawi.page/report-categories?pageSize=100"
Python
import os, requests

r = requests.get("https://cuflora.kawi.page/report-categories?pageSize=100",
                 headers={"Authorization": f"Bearer {os.environ['CUFLORA_KEY']}"})
r.raise_for_status()
datos = r.json()
JavaScript
const r = await fetch("https://cuflora.kawi.page/report-categories?pageSize=100", {
  headers: { Authorization: `Bearer ${process.env.CUFLORA_KEY}` },
});
if (!r.ok) throw new Error(`HTTP ${r.status}`);
const datos = await r.json();
GET

/report-measurementsListar mediciones

Valores medidos en los reportes de medidas, paginados.

Tipo
Lista paginada
Permiso
report-measurements:read
Parámetros
pageNumberconsulta · enteroPágina, desde 1.
pageSizeconsulta · enteroRegistros por página. Con llave, máximo 100.
Relaciones (includes) · in.<relación>=true
report
Respuesta 200 · application/json · ejemplo
{
  "data": [
    {
      "id": 8,
      "reportId": 41,
      "value": "1.8500",
      "measurementUnit": "m",
      "year": 2026,
      "createdAt": "2026-08-21T17:04:11.000Z",
      "updatedAt": "2026-09-28T19:40:02.000Z",
      "deletedAt": null,
      "enabled": true
    }
  ],
  "pagination": {
    "pageNumber": 1,
    "pageSize": 25,
    "totalCount": 25,
    "totalPages": 1,
    "hasNextPage": false,
    "hasPreviousPage": false
  }
}
curl
curl -H "Authorization: Bearer $CUFLORA_KEY" \
  "https://cuflora.kawi.page/report-measurements?pageSize=100"
Python
import os, requests

r = requests.get("https://cuflora.kawi.page/report-measurements?pageSize=100",
                 headers={"Authorization": f"Bearer {os.environ['CUFLORA_KEY']}"})
r.raise_for_status()
datos = r.json()
JavaScript
const r = await fetch("https://cuflora.kawi.page/report-measurements?pageSize=100", {
  headers: { Authorization: `Bearer ${process.env.CUFLORA_KEY}` },
});
if (!r.ok) throw new Error(`HTTP ${r.status}`);
const datos = await r.json();
GET

/reports/{id}Ver un reporte

Un reporte por su id. Con in.measurement=true trae la medición, si la tiene.

Tipo
Un registro
Permiso
reports:read
Parámetros
idruta · número Obligatorio.
Relaciones (includes) · in.<relación>=true
childrenimagesmainCategorymeasurementparentsubcategory
Respuesta 200 · application/json · ejemplo
{
  "id": 40,
  "mainCategoryId": 7,
  "subcategoryId": 52,
  "subjectId": 12,
  "reporterId": 9,
  "description": "Floración inicial",
  "parentId": null,
  "replyKind": null,
  "createdAt": "2026-08-21T17:04:11.000Z",
  "updatedAt": "2026-09-28T19:40:02.000Z",
  "deletedAt": null,
  "enabled": true
}
curl
curl -H "Authorization: Bearer $CUFLORA_KEY" \
  "https://cuflora.kawi.page/reports/1"
Python
import os, requests

r = requests.get("https://cuflora.kawi.page/reports/1",
                 headers={"Authorization": f"Bearer {os.environ['CUFLORA_KEY']}"})
r.raise_for_status()
datos = r.json()
JavaScript
const r = await fetch("https://cuflora.kawi.page/reports/1", {
  headers: { Authorization: `Bearer ${process.env.CUFLORA_KEY}` },
});
if (!r.ok) throw new Error(`HTTP ${r.status}`);
const datos = await r.json();
GET

/report-images/{id}Ver una foto de reporte

Una relación foto-reporte por su id.

Tipo
Un registro
Permiso
report-images:read
Parámetros
idruta · número Obligatorio.
Respuesta 200 · application/json · ejemplo
{
  "id": 5,
  "reportId": 40,
  "imageId": 31,
  "createdAt": "2026-08-21T17:04:11.000Z",
  "updatedAt": "2026-09-28T19:40:02.000Z",
  "deletedAt": null,
  "enabled": true
}
curl
curl -H "Authorization: Bearer $CUFLORA_KEY" \
  "https://cuflora.kawi.page/report-images/1"
Python
import os, requests

r = requests.get("https://cuflora.kawi.page/report-images/1",
                 headers={"Authorization": f"Bearer {os.environ['CUFLORA_KEY']}"})
r.raise_for_status()
datos = r.json()
JavaScript
const r = await fetch("https://cuflora.kawi.page/report-images/1", {
  headers: { Authorization: `Bearer ${process.env.CUFLORA_KEY}` },
});
if (!r.ok) throw new Error(`HTTP ${r.status}`);
const datos = await r.json();
GET

/report-categories/{id}Ver una categoría de reporte

Una categoría o subtipo por su id.

Tipo
Un registro
Permiso
report-categories:read
Parámetros
idruta · número Obligatorio.
Relaciones (includes) · in.<relación>=true
parentsubcategories
Respuesta 200 · application/json · ejemplo
{
  "id": 7,
  "name": "Medidas",
  "description": null,
  "parentId": null,
  "defaultUnit": null,
  "createdAt": "2026-08-21T17:04:11.000Z",
  "updatedAt": "2026-09-28T19:40:02.000Z",
  "deletedAt": null,
  "enabled": true
}
curl
curl -H "Authorization: Bearer $CUFLORA_KEY" \
  "https://cuflora.kawi.page/report-categories/1"
Python
import os, requests

r = requests.get("https://cuflora.kawi.page/report-categories/1",
                 headers={"Authorization": f"Bearer {os.environ['CUFLORA_KEY']}"})
r.raise_for_status()
datos = r.json()
JavaScript
const r = await fetch("https://cuflora.kawi.page/report-categories/1", {
  headers: { Authorization: `Bearer ${process.env.CUFLORA_KEY}` },
});
if (!r.ok) throw new Error(`HTTP ${r.status}`);
const datos = await r.json();
GET

/report-measurements/{id}Ver una medición

Una medición por su id.

Tipo
Un registro
Permiso
report-measurements:read
Parámetros
idruta · número Obligatorio.
Relaciones (includes) · in.<relación>=true
report
Respuesta 200 · application/json · ejemplo
{
  "id": 8,
  "reportId": 41,
  "value": "1.8500",
  "measurementUnit": "m",
  "year": 2026,
  "createdAt": "2026-08-21T17:04:11.000Z",
  "updatedAt": "2026-09-28T19:40:02.000Z",
  "deletedAt": null,
  "enabled": true
}
curl
curl -H "Authorization: Bearer $CUFLORA_KEY" \
  "https://cuflora.kawi.page/report-measurements/1"
Python
import os, requests

r = requests.get("https://cuflora.kawi.page/report-measurements/1",
                 headers={"Authorization": f"Bearer {os.environ['CUFLORA_KEY']}"})
r.raise_for_status()
datos = r.json()
JavaScript
const r = await fetch("https://cuflora.kawi.page/report-measurements/1", {
  headers: { Authorization: `Bearer ${process.env.CUFLORA_KEY}` },
});
if (!r.ok) throw new Error(`HTTP ${r.status}`);
const datos = await r.json();
GET

/reports/exportExportar reportes a CSV

Reportes en un CSV. Filtra por planta (subjectId) y por día (from, to, en formato AAAA-MM-DD, incluidos).

Tipo
Archivo CSV · 10 por hora por llave
Permiso
reports:export
Parámetros
subjectIdconsulta · número
reporterIdconsulta · número
fromconsulta · texto
toconsulta · texto
Respuesta 200 · text/csv · ejemplo
id,fecha,categoria,subtipo,planta,…
curl
curl -H "Authorization: Bearer $CUFLORA_KEY" \
  "https://cuflora.kawi.page/reports/export" \
  -o cuflora.csv
Python
import os, requests

r = requests.get("https://cuflora.kawi.page/reports/export",
                 headers={"Authorization": f"Bearer {os.environ['CUFLORA_KEY']}"})
r.raise_for_status()
open("cuflora.csv", "wb").write(r.content)
JavaScript
const r = await fetch("https://cuflora.kawi.page/reports/export", {
  headers: { Authorization: `Bearer ${process.env.CUFLORA_KEY}` },
});
if (!r.ok) throw new Error(`HTTP ${r.status}`);
const csv = await r.text();
GET

/reports/measurements/exportExportar mediciones a CSV

Un renglón por medición, en un CSV para análisis. Filtra por planta (subjectId), por qué se midió (subcategoryId) y por día (from, to).

Tipo
Archivo CSV · 10 por hora por llave
Permiso
reports:export
Parámetros
subjectIdconsulta · número
subcategoryIdconsulta · número
fromconsulta · texto
toconsulta · texto
Respuesta 200 · text/csv · ejemplo
planta,metrica,valor,unidad,año,…
curl
curl -H "Authorization: Bearer $CUFLORA_KEY" \
  "https://cuflora.kawi.page/reports/measurements/export" \
  -o cuflora.csv
Python
import os, requests

r = requests.get("https://cuflora.kawi.page/reports/measurements/export",
                 headers={"Authorization": f"Bearer {os.environ['CUFLORA_KEY']}"})
r.raise_for_status()
open("cuflora.csv", "wb").write(r.content)
JavaScript
const r = await fetch("https://cuflora.kawi.page/reports/measurements/export", {
  headers: { Authorization: `Bearer ${process.env.CUFLORA_KEY}` },
});
if (!r.ok) throw new Error(`HTTP ${r.status}`);
const csv = await r.text();