Overview
The Dashboard API provides aggregated production metrics, trends, and analytics data for visualization and business intelligence. It offers monthly summaries and historical production graphs.Base URL
Get Current Month Summary
Response
HTTP status code (200 for success)
“Resumen del mes actual”
Monthly summary data:
Name of the previous month (e.g., “Febrero”)
Indicates success (true)
Get Production Graph Data
Query Parameters
Product category to analyze. Valid values:
- leches: Milk products
- quesos: Cheese products
Metric to calculate. Valid values:
- cantidad: Production quantity
- mermas: Waste amount
- costos: Direct costs
Response
HTTP status code (200 for success)
“Resumen de los ultimo 6 meses”
Indicates success (true)
Understanding Variations
Thevariaciones field in the monthly summary shows percentage changes:
- Positive values (e.g., 12.5): Indicates an increase compared to the previous month
- Negative values (e.g., -5.2): Indicates a decrease compared to the previous month
- Null values: No data available for the previous month (first month of operation)
Calculation Formula
Use Cases
Monthly Performance Dashboard
Use/dashboard/mes-actual to display:
- Current month production totals
- Month-over-month performance indicators
- Cost trends and efficiency metrics
Production Trend Charts
Use/dashboard/grafico to generate:
- Line charts showing production over time
- Cost analysis graphs
- Waste trend visualization
- Comparative analysis between product categories
Error Responses
400 Bad Request
- Missing required query parameters (producto or metrica)
- Invalid product category (must be “leches” or “quesos”)
- Invalid metric (must be “cantidad”, “mermas”, or “costos”)
- User has no registered establishment
401 Unauthorized
- Missing or invalid authentication token
500 Internal Server Error
- Unexpected server error
- Database calculation errors
