[comment]: # ({316af8fa-f9e8f670})
# templategroup.massupdate

[comment]: # ({/316af8fa-f9e8f670})

[comment]: # ({ba2bf0cc-b5ff62ed})
### 説明

`object templategroup.massupdate(object parameters)`

このメソッドは、複数のテンプレートグループの指定されたテンプレートを置き換えることができます。

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

[comment]: # ({/ba2bf0cc-b5ff62ed})

[comment]: # ({7e076b27-3ff1a765})
### パラメータ

`(object)` 更新するテンプレートグループと更新対象のオブジェクトのIDを含むパラメータ

|パラメータ|[タイプ](/manual/api/reference_commentary#data_types)|説明|
|--|--|------|
|groups|object/array|更新する[テンプレートグループ](/manual/api/reference/templategroup/object#template_group)<br><br>テンプレートグループには `groupid` プロパティのみを定義する必要があります。<br><br>[パラメータの動作](/manual/api/reference_commentary#parameter-behavior):<br>- *必須*|
|templates|object/array|[テンプレート](/manual/api/reference/template/object#template)を使用して、指定されたテンプレート グループの現在のテンプレートを置き換えます。<br>指定されたテンプレート以外のすべてのテンプレートは、テンプレート グループから除外されます。<br><br>テンプレートには、`templateid` プロパティのみが定義されている必要があります。<br><br>[パラメーターの動作](/manual/api/reference_commentary#parameter-behavior):<br>- *必須*|

[comment]: # ({/7e076b27-3ff1a765})

[comment]: # ({9cf84bdf-2acda80b})
### 戻り値

`(object)` `groupids`プロパティの下に更新されたテンプレートグループのIDを含むオブジェクトを返します。

[comment]: # ({/9cf84bdf-2acda80b})

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

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

[comment]: # ({c8b27a38-2f48a174})
#### テンプレートグループ内のテンプレートを置き換える

テンプレートグループ内のすべてのテンプレートを、指定のテンプレートに置き換えます。

[リクエスト](/manual/api#performing-requests) :

```json
{
    "jsonrpc": "2.0",
    "method": "templategroup.massupdate",
    "params": {
        "groups": [
            {
                "groupid": "8"
            }
        ],
        "templates": [
            {
                "templateid": "40050"
            }
        ]
    },
    "id": 1
}
```

レスポンス :

```json
{
    "jsonrpc": "2.0",
    "result": {
        "groupids": [
            "8",
        ]
    },
    "id": 1
}
```

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

[comment]: # ({00455354-b67f136e})
### 参照

-   [templategroup.update](update)
-   [templategroup.massadd](massadd)
-   [Template](/manual/api/reference/template/object#template)

[comment]: # ({/00455354-b67f136e})

[comment]: # ({052332f3-1d8a51d4})
### ソース

CTemplateGroup::massUpdate() in
*ui/include/classes/api/services/CTemplateGroup.php*.

[comment]: # ({/052332f3-1d8a51d4})
