Display Data on Graph [Go to Tutorial]
This endpoint allows you to display data on a graph. Rate limited to one request every 5 seconds per dataset.
Request Type: POST
Endpoint URL: https://api.leftoverlabs.com/graph/data/create/
Headers:
- api-key: Your Key generated via API Credentials
- dataset-id: The Dataset ID generated after creating a Graph and Dataset
Request Fields:
- sensor_value: string (required) - The sensor value to be recorded
- timestamp: string (optional) - ISO 8601 formatted datetime. If not provided, current server time is used
Example:
{
"sensor_value": "23.5",
"timestamp": "2024-08-05T12:30:00Z"
}
Response Fields:
- status: string - Success message confirming data registration
Example:
{
"status": "Data registered successfully"
}
Response Status Options:
- 200: Data has been created
- 400: There is an issue with the request data
- 403: Permission Denied - Issue with Authorisation
- 429: Too Many Requests - Rate limit exceeded (one request per 5 seconds per dataset)
Bulk Display Data on Graph [Go to Tutorial]
This endpoint allows you to bulk display data on a graph when the monitoring service is down.
Request Type: POST
Endpoint URL: https://api.leftoverlabs.com/graph/data/bulk-create/
Headers:
- api-key: Your Key generated via API Credentials
- dataset-id: The Dataset ID generated after creating a Graph and Dataset
Request Fields:
- data_points: array (required, min_length=1) - List of data point objects
- data_points[].sensor_value: string (required) - The sensor value for this data point
- data_points[].timestamp: string (required) - ISO 8601 formatted datetime for this data point
Example:
{
"data_points": [
{
"sensor_value": "23.5",
"timestamp": "2024-08-05T12:30:00Z"
},
{
"sensor_value": "24.1",
"timestamp": "2024-08-05T12:35:00Z"
},
{
"sensor_value": "23.8",
"timestamp": "2024-08-05T12:40:00Z"
}
]
}
Response Fields:
- status: string - Success message confirming bulk data registration
- count: integer - Number of data points successfully created
Example:
{
"status": "Data registered successfully",
"count": 3
}
Response Status Options:
- 200: Data has been created
- 400: There is an issue with the request data
- 403: Permission Denied - Issue with Authorisation
Funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Education and Culture Executive Agency (EACEA). Neither the European Union nor EACEA can be held responsible for them.
Project Number: 2023-3-CY02-KA210-YOU-000173087