List reports
GET /reports/ returns the reports with their fields and dynamic filters.
Returns every report with its fields, its dynamic filters and its chart settings. Enable the API first.
Request
curl -H "x-token: YOUR_TOKEN" http://localhost:8000/reports/You can also send the token as ?token=YOUR_TOKEN.
Response
[
{
"id": "JapOn71ca61f",
"name": "Orders by country and period",
"category": "",
"filter": [
{ "id": "xfu9n6e", "type": "=", "value": "{Country}", "name": "Country", "datatype": "string" },
{ "id": "xg41zyw", "type": "between", "value": "{From}; {To}", "name": "Created", "datatype": "date" }
],
"fields": [
{ "id": "xa0wfry", "name": "Customer", "datatype": "string" },
{ "id": "total", "name": "Total", "datatype": "number" }
],
"chart": false
},
{
"id": "JapNSY1c161f",
"name": "Sales by product",
"category": "Sales",
"filter": [],
"fields": [
{ "id": "x1twuy9b", "name": "Product", "datatype": "string" },
{ "id": "total", "type": "sum", "name": "Total", "datatype": "number" }
],
"chart": true,
"x": "x1twuy9b",
"y": "total",
"series": ""
}
]| Key | Meaning |
|---|---|
id | The ID of the report. Use it to load the report. |
name, category | As in the report form. |
fields | The fields of the report: id, name, datatype (the type in the view) and type (the operation, when there is one). |
filter | Only the dynamic filters, whose values you send when you load the report. |
chart | true if the report has chart settings. Then x, y and series hold the IDs of the chosen fields. |
After you create or change a view, restart OpenReports so that this list shows the fields and filters of the reports that use it.