/api/v1/tenants/{tenantId}/* endpoints instead.
These legacy endpoints are maintained for compatibility but new integrations should use the tenant-scoped endpoints.
Get Recent Messages
Retrieve the most recent sensor messages from Redis cache.Query Parameters
Number of messages to retrieve (1-1000)
Response
Returns an array ofRealDataDto objects with 22 sensor fields.
ISO 8601 timestamp
Temperature reading for greenhouse 1
Humidity reading for greenhouse 1
Greenhouse identifier
Example
cURL
Response
Get Messages by Time Range
Query messages within a specific time period.Query Parameters
Start timestamp (ISO 8601 format)
End timestamp (ISO 8601 format)
Example
cURL
Get Sensor Statistics
Calculate statistics for a specific sensor over a time period.Sensor field name (e.g., “TEMPERATURA INVERNADERO 01”)
Query Parameters
Time period:
1h, 24h, 7d, 30dResponse
Sensor field name
Time period analyzed
Minimum value in period
Maximum value in period
Average value in period
Number of readings
Most recent value
Example
cURL
Response
Get Summary Statistics
Get aggregated statistics for all sensors.Query Parameters
Time period:
1h, 24h, 7d, 30dExample
cURL
Get Cache Info
Check Redis cache status and metadata.Response
Number of messages in cache (max 1000)
Time-to-live in seconds (86400 = 24 hours)
Maximum cache capacity (1000)
Cache utilization (0-100%)
Data structure type (“Redis Sorted Set”)
Timestamp of oldest cached message
Timestamp of newest cached message
Example
cURL
Response
Health Check
Simple health check endpoint.{"status": "UP"} if the service is healthy.
Example
cURL
Migration Guide
For new implementations, use the tenant-scoped endpoints:| Legacy Endpoint | New Endpoint |
|---|---|
GET /api/v1/greenhouse/messages/recent | GET /api/v1/sensors/latest |
GET /api/v1/greenhouse/messages/range | GET /api/v1/sensors/by-greenhouse/{greenhouseId} |
GET /api/v1/greenhouse/statistics/{sensorId} | GET /api/v1/statistics/historical-data |
GET /api/v1/greenhouse/statistics/summary | GET /api/v1/statistics/summary |
The new endpoints provide better multi-tenant isolation and support for filtering by tenant, greenhouse, and sensor.