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

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

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

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

このメソッドは新しいテンプレートダッシュボードを作成します。

::: noteclassic
このメソッドは*管理者*および*スーパ管理者*ユーザータイプでのみ利用可能です。メソッドを呼び出す権限はユーザーロールの設定で取り消すことができます。詳細は[ユーザーロール](/manual/web_interface/frontend_sections/users/user_roles)を参照してください。
:::

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

[comment]: # ({3479d924-1caae149})
### パラメータ

`(object/array)` 作成するテンプレートダッシュボード。

[標準のテンプレートダッシュボードの
プロパティ](object#template-dashboard)に加えて、このメソッドは以下の
パラメータを受け付けます。

|パラメータ|[型](/manual/api/reference_commentary#data-types)|説明|
|--|--|------|
|pages|array|ダッシュボード用に作成する[テンプレートダッシュボードページ](/manual/api/reference/templatedashboard/object#template-dashboard-page)。ダッシュボードページは、指定された順序と同じ順序で並べられます。<br><br>[パラメータの動作](/manual/api/reference_commentary#parameter-behavior):<br>- *必須*|

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

[comment]: # ({4bfe9ed0-4bfe9ed0})
### 戻り値

`(object)` `dashboardids` プロパティの下に作成されたテンプレート ダッシュボードの ID を含むオブジェクトを返します。 返される ID の順序は、渡されたテンプレート ダッシュボードの順序と一致します。

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

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

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

[comment]: # ({41c665c3-49684d2f})
#### テンプレートダッシュボードの作成

1つのダッシュボードページに1つのグラフウィジェットを持つ「Graphs」という名前のテンプレートダッシュボードを作成します。

[リクエスト](/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
}
```

レスポンス:

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

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

[comment]: # ({930bd864-1171cc63})
### 関連項目

-   [テンプレートダッシュボードページ](object#template-dashboard-page)
-   [テンプレートダッシュボードウィジェット](object#template-dashboard-widget)
-   [テンプレートダッシュボードウィジェット
    フィールド](object#template-dashboard-widget-field)

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

[comment]: # ({78c6e281-78c6e281})
### ソース

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

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