[comment]: # aside: 4

[comment]: # translation:outdated

[comment]: # ({f7884974-f7884974})
# dashboard.get

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

[comment]: # ({29679c8d-8d36c9b5})
### Descrizione

`integer/array dashboard.get(object parameters)`

Il metodo consente di recuperare le dashboard in base ai parametri
specificati.

::: noteclassic
Questo metodo è disponibile per utenti di qualsiasi tipo. I permessi
per chiamare il metodo possono essere revocati nelle impostazioni dei ruoli utente. Consultare [Ruoli
utente](/manual/web_interface/frontend_sections/users/user_roles)
per ulteriori informazioni.
:::

[comment]: # ({/29679c8d-8d36c9b5})

[comment]: # ({af217620-342bbd26})
### Parametri

`(object)` Parametri che definiscono l'output desiderato.

Il metodo supporta i seguenti parametri.

|Parametro|[Type](/manual/api/reference_commentary#data-types)|Descrizione|
|--|--|------|
|dashboardids|ID/array|Restituisce solo le dashboard con gli ID specificati.|
|selectPages|query|Restituisce una proprietà [`pages`](/manual/api/reference/dashboard/object#dashboard-page) con le pagine della dashboard, ordinate correttamente.|
|selectUsers|query|Restituisce una proprietà [`users`](/manual/api/reference/dashboard/object#dashboard-user) con gli utenti con cui la dashboard è condivisa.|
|selectUserGroups|query|Restituisce una proprietà [`userGroups`](/manual/api/reference/dashboard/object#dashboard-user-group) con i gruppi di utenti con cui la dashboard è condivisa.|
|sortfield|string/array|Ordina il risultato in base alle proprietà specificate.<br><br>Valori possibili: `dashboardid`.|
|countOutput|boolean|Questi parametri sono descritti nel [commento di riferimento](/manual/api/reference_commentary#common-get-method-parameters).|
|editable|boolean|^|
|excludeSearch|boolean|^|
|filter|object|^|
|limit|integer|^|
|output|query|^|
|preservekeys|boolean|^|
|search|object|^|
|searchByAny|boolean|^|
|searchWildcardsEnabled|boolean|^|
|sortorder|string/array|^|
|startSearch|boolean|^|

[comment]: # ({/af217620-342bbd26})

[comment]: # ({7223bab1-7223bab1})
### Valori restituiti

`(intero/array)` Restituisce:

- un array di oggetti;
- il conteggio degli oggetti recuperati, se è stato utilizzato il parametro
`countOutput`.

[comment]: # ({/7223bab1-7223bab1})

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

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

[comment]: # ({b8f24ab7-84a10cd6})
#### Recupero di una dashboard tramite ID

Recupera tutti i dati delle dashboard "1" e "2".

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

```json
{
    "jsonrpc": "2.0",
    "method": "dashboard.get",
    "params": {
        "output": "extend",
        "selectPages": "extend",
        "selectUsers": "extend",
        "selectUserGroups": "extend",
        "dashboardids": [
            "1",
            "2"
        ]
    },
    "id": 1
}
```

Risposta:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "dashboardid": "1",
            "name": "Dashboard",
            "userid": "1",
            "private": "0",
            "display_period": "30",
            "auto_start": "1",
            "users": [],
            "userGroups": [],
            "pages": [
                {
                    "dashboard_pageid": "1",
                    "name": "",
                    "display_period": "0",
                    "widgets": [
                        {
                            "widgetid": "9",
                            "type": "systeminfo",
                            "name": "",
                            "x": "12",
                            "y": "8",
                            "width": "12",
                            "height": "5",
                            "view_mode": "0",
                            "fields": []
                        },
                        {
                            "widgetid": "8",
                            "type": "problemsbysv",
                            "name": "",
                            "x": "12",
                            "y": "4",
                            "width": "12",
                            "height": "4",
                            "view_mode": "0",
                            "fields": []
                        },
                        {
                            "widgetid": "7",
                            "type": "problemhosts",
                            "name": "",
                            "x": "12",
                            "y": "0",
                            "width": "12",
                            "height": "4",
                            "view_mode": "0",
                            "fields": []
                        },
                        {
                            "widgetid": "6",
                            "type": "discovery",
                            "name": "",
                            "x": "6",
                            "y": "9",
                            "width": "18",
                            "height": "4",
                            "view_mode": "0",
                            "fields": []
                        },
                        {
                            "widgetid": "5",
                            "type": "web",
                            "name": "",
                            "x": "0",
                            "y": "9",
                            "width": "18",
                            "height": "4",
                            "view_mode": "0",
                            "fields": []
                        },
                        {
                            "widgetid": "4",
                            "type": "problems",
                            "name": "",
                            "x": "0",
                            "y": "3",
                            "width": "12",
                            "height": "6",
                            "view_mode": "0",
                            "fields": []
                        },
                        {
                            "widgetid": "3",
                            "type": "favmaps",
                            "name": "",
                            "x": "8",
                            "y": "0",
                            "width": "12",
                            "height": "3",
                            "view_mode": "0",
                            "fields": []
                        },
                        {
                            "widgetid": "1",
                            "type": "favgraphs",
                            "name": "",
                            "x": "0",
                            "y": "0",
                            "width": "12",
                            "height": "3",
                            "view_mode": "0",
                            "fields": []
                        }
                    ]
                },
                {
                    "dashboard_pageid": "2",
                    "name": "",
                    "display_period": "0",
                    "widgets": []
                },
                {
                    "dashboard_pageid": "3",
                    "name": "Custom page name",
                    "display_period": "60",
                    "widgets": []
                }
            ]
        },
        {
            "dashboardid": "2",
            "name": "My dashboard",
            "userid": "1",
            "private": "1",
            "display_period": "60",
            "auto_start": "1",
            "users": [
                {
                    "userid": "4",
                    "permission": "3"
                }
            ],
            "userGroups": [
                {
                    "usrgrpid": "7",
                    "permission": "2"
                }
            ],
            "pages": [
                {
                    "dashboard_pageid": "4",
                    "name": "",
                    "display_period": "0",
                    "widgets": [
                        {
                            "widgetid": "10",
                            "type": "problems",
                            "name": "",
                            "x": "0",
                            "y": "0",
                            "width": "12",
                            "height": "5",
                            "view_mode": "0",
                            "fields": [
                                {
                                    "type": "2",
                                    "name": "groupids",
                                    "value": "4"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "id": 1
}
```

[comment]: # ({/b8f24ab7-84a10cd6})

[comment]: # ({9c4ba6ce-299ae089})
### Vedi anche

-   [Pagina dashboard](object#dashboard-page)
-   [Widget dashboard](object#dashboard-widget)
-   [Campo del widget dashboard](object#dashboard-widget-field)
-   [Utente dashboard](object#dashboard-user)
-   [Gruppo utenti dashboard](object#dashboard-user-group)

[comment]: # ({/9c4ba6ce-299ae089})

[comment]: # ({75a9042e-75a9042e})
### Sorgente

CDashboard::get() in *ui/include/classes/api/services/CDashboard.php*.

[comment]: # ({/75a9042e-75a9042e})
