[comment]: # translation:outdated

[comment]: # ({2aef6e95-2aef6e95})
# templatedashboard.create

[comment]: # ({/2aef6e95-2aef6e95})

[comment]: # ({9231e0c6-8072f2f2})
### Descrizione

`object templatedashboard.create(object/array templateDashboards)`

Questo metodo consente di creare nuovi dashboard di template.

::: noteclassic
Questo metodo è disponibile solo per i tipi di utente *Admin* e *Super admin*.
Le autorizzazioni per chiamare il metodo possono essere revocate nelle impostazioni del ruolo utente.
Per ulteriori informazioni, vedere [Ruoli utente](/manual/web_interface/frontend_sections/users/user_roles).
:::

[comment]: # ({/9231e0c6-8072f2f2})

[comment]: # ({3479d924-1caae149})
### Parametri

`(object/array)` Dashboard del template da creare.

Oltre alle [proprietà standard del dashboard del
template](object#template-dashboard), il metodo accetta i seguenti
parametri.

|Parametro|[Type](/manual/api/reference_commentary#data-types)|Descrizione|
|--|--|------|
|pages|array|[Pagine del dashboard del template](/manual/api/reference/templatedashboard/object#template-dashboard-page) da creare per il dashboard. Le pagine del dashboard saranno ordinate nello stesso ordine in cui sono specificate.<br><br>[Comportamento del parametro](/manual/api/reference_commentary#parameter-behavior):<br>- *obbligatorio*|

[comment]: # ({/3479d924-1caae149})

[comment]: # ({4bfe9ed0-4bfe9ed0})
### Valori di ritorno

`(object)` Restituisce un oggetto contenente gli ID del modello dashboard creato
sotto la proprietà `dashboardids`. L'ordine degli ID restituiti corrisponde all'ordine dei modelli dashboard passati.

[comment]: # ({/4bfe9ed0-4bfe9ed0})

[comment]: # ({b41637d2-b41637d2})
### Esempi

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({41c665c3-49684d2f})
#### Creazione di una dashboard del template

Creare una dashboard del template denominata “Graphs” con un widget Graph in una
singola pagina della dashboard.

[Richiesta](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "templatedashboard.create",
    "params": {
        "templateid": "10318",
        "name": "Graphs",
        "pages": [
            {
                "widgets": [
                    {
                        "type": "graph",
                        "x": 0,
                        "y": 0,
                        "width": 12,
                        "height": 5,
                        "view_mode": 0,
                        "fields": [
                            {
                                "type": 6,
                                "name": "graphid",
                                "value": "1123"
                            }
                        ]
                    }
                ]

            }
        ]
    },
    "id": 1
}
```

Risposta:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "dashboardids": [
            "32"
        ]
    },
    "id": 1
}
```

[comment]: # ({/41c665c3-49684d2f})

[comment]: # ({930bd864-1171cc63})
### Vedi anche

-   [Pagina dashboard del template](object#template-dashboard-page)
-   [Widget della dashboard del template](object#template-dashboard-widget)
-   [Campo del widget della dashboard del template](object#template-dashboard-widget-field)

[comment]: # ({/930bd864-1171cc63})

[comment]: # ({78c6e281-78c6e281})
### Fonte

CTemplateDashboard::create() in
*ui/include/classes/api/services/CTemplateDashboard.php*.

[comment]: # ({/78c6e281-78c6e281})
