Actions6
- Collection API Actions
- Enrichment API Actions
- Extraction API Actions
- Measurement API Actions
Overview
This node integrates with the Piano Analytics Measurement API to send measurement data from any platform. It allows users to post structured measurement events, such as temperature readings or other custom metrics, directly to Piano Analytics for tracking and analysis.
Common scenarios include:
- Sending IoT sensor data (e.g., temperature, humidity) to Piano Analytics.
- Reporting custom business metrics or KPIs collected outside of web analytics.
- Integrating offline or third-party system measurements into Piano Analytics dashboards.
For example, a user could send an array of temperature measurements tagged with location and device properties to track environmental conditions over time.
Properties
| Name | Meaning |
|---|---|
| Region | The geographic region of the Piano Analytics endpoint to use. Options: "EU", "US". |
| Measurements Array | A JSON array containing one or more measurement objects. Each object includes keys like key (metric name), period (timestamp), values (metric values), properties (additional metadata), and site_id (identifier). |
Example structure of the Measurements Array property:
{
"measurements": [
{
"key": "temperature",
"period": "2023-01-01T12:00:00",
"values": {
"celsius": 25.5,
"fahrenheit": 77.9
},
"properties": {
"geo_city": "Paris",
"probe": "Siemens"
},
"site_id": 1245695
}
]
}
Output
The node outputs a JSON array where each element corresponds to the response from the Piano Analytics API for each input item processed.
- If the API returns content, it is parsed from JSON and returned as the output.
- If no content is returned (HTTP 204), the node outputs an object indicating
"Status Code": "204 No Content".
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authenticating requests to the Piano Analytics API.
- The node sends HTTP POST requests to the Piano Analytics Measurement API endpoint, which varies based on the selected region (
euorus). - Proper network access to
https://analytics-api-{region}.piano.io/import/measurements/v1is required.
Troubleshooting
- Missing Credentials: The node will throw an error if the required API credentials are not provided. Ensure that a valid API key credential is configured in n8n.
- Invalid JSON in Measurements Array: The measurements must be valid JSON. Malformed JSON will cause parsing errors.
- API Errors: Any error returned by the Piano Analytics API will be wrapped and reported by the node. Check the error message and stack trace for details.
- Region Misconfiguration: Selecting an incorrect region may lead to failed requests. Verify the region matches your Piano Analytics account setup.
- Empty Response: If the API returns no content, the node outputs a status code message. This is normal behavior but indicates no data was returned.