Are you building a dashboard using the SquaredUp WebAPI plugin? Here are some tips that could make the process a lot easier.
1. Know when to use the Web API Plugin
Working with an API that returns JSON over HTTP/HTTPS? The Web API plugin is your go-to when there’s no built-in plugin available and you want a simple, no-scripting setup.
2. Test the API before you hit the “Add”
When configuring your data source, after entering the base URL and authentication details, it’s a good idea to test the endpoint first.
Add a valid endpoint path, click Send, and review the response.
This quick test helps catch issues early, so you don’t end up troubleshooting empty dashboard tiles later.
3. How to Use “Path to Data” and when to “Expand inner objects”
When working with APIs that return nested JSON data, it’s important to know how to correctly extract the values you need. Let’s look at two practical examples to understand when you can use a direct path and when it’s better to use Expand inner objects in SquaredUp.
Ex 1: Use a direct Path when the Array Is easily accessible:
Lets say you receive the following response from the API:
{
"actions": {
"alerts": [
{
"checkid": 4543668,
"status": "sent",
"messageshort": "down"
},
{
"checkid": 4543671,
"status": "sent",
"messageshort": "down"
}
]
}
}
In this case, the data you want (alerts) is a simple array inside the actions object. You can access all rows by setting the Path to data as:
actions.alerts
That’s it! Each alert will be shown as a row, with the fields like checkid, status, and messageshort displayed as columns.
Ex 2: Use Expand inner objects for deeper nested structures:
Now let’s take a more complex structure:
{
"reading_log_entries": [
{
"work": {
"title": "The Proudest Blue",
"author_names": ["Ibtihaj Muhammad", "S. K. Ali"]
},
"logged_date": "2025/04/20"
},
{
"work": {
"title": "Waiting for dessert",
"author_names": ["Geoffrey Stokes"]
},
"logged_date": "2025/04/25"
}
]
}
Here, each work object is nested inside each item of the reading_log_entries
array.
If you try to use a path like:
reading_log_entries.work
…it won’t work. That’s because work is not a property of the array itself, it’s a property of each item inside the array. While you can technically access reading_log_entries[0].work
, that only returns one result - Might not be what you are looking for to build a dashboard.
Instead, use:
reading_log_entries
in Path to data and enable Expand inner objects.
This will flatten all the fields from work (like title, author names, etc) into your table, giving you a complete view of all entries.
So to summarize :
- Use a direct path when your array is straightforward.
- Use Expand Inner Objects with base path when you’re dealing with nested objects inside array items.
4. Make your dashboards Smarter with dynamic time filters
When visualizing time-series data (like CPU usage, alerts, or logs), it’s common for APIs to return a large time window, often multiple days or weeks. But what if your dashboard only cares about the last 24 hours?
That’s where SquaredUp’s Mustache parameters come in - they let you dynamically insert time values based on the dashboard’s selected timeframe.
For example, if your API supports filtering by date via query parameters, you can simply configure it like this:
When your dashboard is set to “Last 24 hours”, SquaredUp automatically replaces these placeholders with ISO 8601 timestamps like:
start_date : 2025-04-29T12:00:00Z
end_date : 2025-04-30T12:00:00Z
This ensures that your tile only queries and shows data for the most relevant timeframe, without needing to hardcode or manually adjust anything.
You can insert these parameters in different parts of your API configuration:
• Base URL
• Query parameters
• Headers
Always check the API documentation to know where the time filters should be passed.
Just make sure the key names match what your API expects, for example, some APIs use start_date, others may use from and to.
I hope these tips help make your dashboard creation process smoother. If you have any other tips to share or any questions, do let us know in the comments!