What You'll Learn
Understand when and why to use the ENLYZE API data source
Make your first API request to the ENLYZE platform API
Parse JSON responses using JSONPath
Display API data in Grafana panels
Completed Part 1-3 tutorials (basic Grafana knowledge)
Access to Grafana with both ENLYZE data sources configured
So far, you've used the ENLYZE data source to build dashboards. It's simple and effective for most use cases. But for advanced scenarios, you need the ENLYZE API data source (powered by the Infinity plugin).
ENLYZE Data Source vs. ENLYZE API Data Source
Advanced (JSONPath/JSONata)
When to Use the ENLYZE API Data Source
Use the ENLYZE API data source when you need:
Dashboard variables – Dynamic dropdowns for site, machine, product selection
Alerting – Grafana alerts only work with the ENLYZE API data source
OEE/Productivity metrics – The productivity-metrics API endpoint
Production runs and downtimes – Historical production data
Custom data combinations – Joining data from multiple endpoints
The ENLYZE API data source connects directly to the ENLYZE platform API. Let's understand how it works.
All API requests go to:
This is pre-configured in your Grafana instance.
Your Grafana instance has API authentication pre-configured. You don't need to add any tokens or credentials – it's already set up.
All ENLYZE API endpoints return paginated JSON responses:
Key points:
data – Array containing the actual results
next_cursor – Pagination token (null if no more pages)
Your First ENLYZE API Query
Let's create a panel that lists all machines using the API.
Step 1: Create a New Panel
Create a new dashboard or open an existing one
Click Add → Visualization
Select Table as the visualization type
Step 2: Select the ENLYZE API Data Source
In the query editor, click the data source dropdown
Select ENLYZE API (not ENLYZE)
[SCREENSHOT: Data source dropdown showing ENLYZE API selection]
Configure these settings:
[SCREENSHOT: ENLYZE API query configuration for machines endpoint]
Note: You only need to enter machines, not the full URL. The base URL is already configured.
Step 4: Add Root Selector
The API returns data wrapped in a data array. To extract it:
Find the Root selector field
This JSONPath expression tells Grafana to use the data array as the source.
[SCREENSHOT: Root selector configuration]
Step 5: View Results
Click Refresh or wait for the panel to update. You should see a table with:
[SCREENSHOT: Table showing machines list]
JSONPath Basics
JSONPath is how you navigate JSON data. Here are the essentials:
Common Selectors
JSONPath
Description
Example Result
["Kiefel", "Macchi", ...]
The ENLYZE API wraps results in a data array for pagination. Without the root selector, Grafana would try to display the entire response including next_cursor.
Without root selector:
With $.data root selector:
Let's add another panel to list all sites.
Query Configuration
Expected Result
Querying Variables for a Machine
You can filter API results using query parameters.
Get Variables for a Specific Machine
variables?machine=141e0927-62b3-4e76-8398-ad82d20f397f
This returns only variables (sensors, metrics) for the Kiefel machine.
Expected Result
uuid
machine
display_name
data_type
unit
Organizing Your Query Results
Selecting Columns
By default, Infinity shows all fields. To select specific columns:
Scroll down to the Columns section
Enter the field selector (e.g., name) and a display title
[SCREENSHOT: Column configuration]
You can also use Grafana's transformations (like you learned in Part 3):
Add Organize fields by name
Rename or hide columns as needed
Some API endpoints require POST requests with a request body. We'll cover this in detail in the next tutorial, but here's a preview:
Example: Productivity Metrics
machines/141e0927-62b3-4e76-8398-ad82d20f397f/productivity-metrics
Request Body:
We'll explore POST requests and dynamic time ranges in Tutorial 4.2.
Practical Exercise
Build a dashboard with three panels:
Machines Table – List all machines with name and site UUID
Sites Table – List all sites with name
Variables Table – List variables for the Kiefel machine
Use what you've learned:
JSON type, Backend parser
Common Mistakes
"No data" or Empty Results
Problem: Panel shows "No data"
Solutions:
Check the URL is correct (just machines, not full URL)
Verify root selector is $.data
Make sure Parser is set to "Backend"
Seeing Raw JSON Instead of Table
Problem: Panel shows raw JSON text
Solutions:
Set Format to "Table" (not "Data frame")
Authentication Errors
Problem: 401 or 403 errors
Solution: Contact your ENLYZE administrator – the API token may need to be refreshed.
Tips and Best Practices
Use Backend Parser
Always set Parser to Backend for ENLYZE API queries. This processes data on the Grafana server, which is more reliable and secure.
When building complex queries:
First, get the basic query working with $.data
Then add column selections
Finally, add transformations
Test URLs in Browser
You can test API URLs directly (if you have an API token):
This helps debug issues before configuring Grafana.
You've learned the fundamentals of the ENLYZE API data source:
When to use the ENLYZE API data source vs. the ENLYZE data source
Making GET requests to API endpoints
Using JSONPath root selectors ($.data)
Displaying API results in tables
Continue with:
Quick Reference
ENLYZE API Query Settings
Common Endpoints
Endpoint
Method
Description
Variables for one machine
machines/{uuid}/productivity-metrics
JSONPath Cheat Sheet