Getting Reports

Getting Report Data from a Bloc

circle-exclamation

Get Report Data

GET https://example.mydomain.com/api/get-data-report

⚠️ This endpoint expects a JSON request body even though it uses the GET method.

This endpoint can return:

  • JSON report data

  • an Excel .xlsx file export


Request Body

Name
Type
Description

stationID*

string

The bloc ID. This may be a UUID or numeric ID depending on your instance.

fieldsToReport*

string

Either "all" or a JSON-encoded string of field slugs to include, for example "{\"field_1\":true,\"field_2\":true}"

responseType

string

If set to "blob", returns an Excel .xlsx file instead of JSON

requestedReportData

string

JSON-encoded string containing report date options,

for example

"{\"reportFromDate\":\"2026-03-19 00:00:00\",\"reportToDate\":\"2026-03-19 23:59:59\"}"

dataFilteringData

string

JSON-encoded string containing filter options

for example

"{\"stationID\":\"...\",\"filterDataToQuery\":{\"field_1\":[\"Value\"]},\"currentPage\":1,\"reverse\":false}"


JSON Response Example


Response Notes

  • Response data is a flat array

  • Default ordering is oldest first

  • When fieldsToReport is "all", derived fields may be included:

    • time_stamp

    • date_stamp

  • When fieldsToReport specifies selected fields, only those fields are returned


Excel Response

When responseType is set to "blob", the endpoint returns an Excel .xlsx file.

Example content type:

Note: the current implementation may not return a Content-Disposition filename header, so some clients may need to save the file manually.


Error Responses

401 Unauthorized

400 Bad Request

Depending on the error, additional debug fields may also be returned by the current implementation.


Example Requests

Get all report data as JSON

Get selected fields only

Filter by report date range

Filter by field values

Download Excel file

Last updated