Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read, how they find the site and where they get stuck, so we can improve it (Google Analytics, Microsoft Clarity).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, LinkedIn, Meta, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors
22.5k Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

REST API

The Trendz REST API lets you fetch view data programmatically — for example, to pull computed telemetry into external dashboards, scripts, or third-party tools.

All endpoints are served under the base URL:

http(s)://<trendz-host>:8888/apiTrendz/

Obtain a token by posting credentials to the Trendz login endpoint:

Terminal window
curl -X POST 'http://localhost:8888/apiTrendz/publicApi/auth/login' \
-H 'Content-Type: application/json' \
-d '{"username": "[email protected]", "password": "tenant"}'

Response:

{"token": "YOUR_JWT_TOKEN", "refreshToken": "YOUR_JWT_REFRESH_TOKEN"}

Pass the token in the X-Authorization header of subsequent requests:

X-Authorization: Bearer YOUR_JWT_TOKEN

Access tokens are valid for 2.5 hours; use the refresh token to obtain a new one before expiry.

The primary external endpoint. Returns the computed data for a saved Trendz view.

POST /apiTrendz/publicApi/buildReport
Content-Type: application/json
{
"viewConfigId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"rangeStartTs": 1700000000000,
"rangeEndTs": 1700086400000,
"filters": {
"Building": ["Office A", "Office B"]
}
}
Field Type Required Description
viewConfigId UUID Yes ID of the saved Trendz view to execute
rangeStartTs long No Start of the time range, Unix timestamp in milliseconds
rangeEndTs long No End of the time range, Unix timestamp in milliseconds
filters object No Key-value map of filter field names to selected values; filters must be configured in the view
{
"columnLabels": ["timestamp", "Building", "avgTemperature"],
"dataTable": [
{ "timestamp": 1700000000000, "Building": "Office A", "avgTemperature": 21.4 },
{ "timestamp": 1700003600000, "Building": "Office A", "avgTemperature": 22.1 }
]
}
Field Type Description
columnLabels string[] Ordered list of column names in the report
dataTable object[] Rows of data; each row is a map of column name to value
HTTP status Reason
400 Bad Request The request body is missing required fields or references an invalid view
429 Too Many Requests The server-side queue is full; retry after a short delay
500 Internal Server Error An error occurred while computing the view report
Terminal window
curl -X POST "http://localhost:8888/apiTrendz/publicApi/buildReport" \
-H "Content-Type: application/json" \
-H "X-Authorization: Bearer <jwt-token>" \
-d '{
"viewConfigId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"rangeStartTs": 1700000000000,
"rangeEndTs": 1700086400000
}'