---
title: Caricare un report
project: OpenReports
version: 1.0
section: reference
language: it
license: MIT
url: https://totaljs.es/docs/it/openreports/1-0/reference/api-load-report/
updated: 2026-11-19T07:46:46.798Z
---

# Caricare un report

> POST /reports/ esegue un report e restituisce i suoi campi e le sue righe.

Esegue un report e restituisce le sue righe. Prima [attiva l'API](../../guides/enable-api/).

## Richiesta

```bash
curl -X POST -H "x-token: YOUR_TOKEN" -H "Content-Type: application/json" \
  -d '{"id":"JapOn71ca61f","filter":[{"id":"xfu9n6e","value":"Italy"},{"id":"xg41zyw","value":"2026-09-01; 2026-12-31"}]}' \
  http://localhost:8000/reports/
```

| Chiave | Significato |
|---|---|
| `id` | L'ID del report, da [Elencare i report](../api-list-reports/). Obbligatorio. |
| `filter` | I valori per i filtri dinamici: l'`id` del campo e il suo `value`, sempre come testo. I filtri con un valore fisso non si possono cambiare. |
| `chart` | `true` restituisce i [dati del grafico](../api-chart/) invece delle righe. |

## Risposta

```json
{
	"fields": [
		{ "id": "xa0wfry", "name": "Customer", "datatype": "string" },
		{ "id": "xfu9n6e", "name": "Country", "datatype": "string" },
		{ "id": "x1twuy9b", "name": "Product", "datatype": "string" },
		{ "id": "total", "name": "Total", "datatype": "number", "format": 2 },
		{ "id": "xg41zyw", "name": "Created", "datatype": "date" }
	],
	"rows": [
		{ "xa0wfry": "Luca Rossi", "xfu9n6e": "Italy", "x1twuy9b": "Notebook", "total": 12.5, "xg41zyw": "2026-10-07T13:30:00.000Z" },
		{ "xa0wfry": "Luca Rossi", "xfu9n6e": "Italy", "x1twuy9b": "Office chair", "total": 298, "xg41zyw": "2026-10-28T17:25:00.000Z" }
	]
}
```

- `fields` descrive le colonne in ordine. `format` è il numero di decimali preso dalla vista.
- Ogni riga è un oggetto le cui chiavi sono gli ID dei campi.
- Le date sono in UTC.

## Errori

| Risposta | Motivo |
|---|---|
| `401: Unauthorized` | L'API è disattivata o il token è sbagliato. |
| `404: Not Found` | Nessun report ha questo ID, oppure il report è privato. |
