[comment]: # ({ae0db7b8-ae0db7b8})
# template.massremove

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

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

`object template.massremove(object parameters)`

このメソッドで、関連するオブジェクトを複数のテンプレートから削除できます。

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

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

[comment]: # ({7ce45f78-bd7f8b44})
### パラメータ

`(object)` 更新するテンプレートの ID と削除する必要があるオブジェクトを含むパラメーター。

|パラメータ|[タイプ](/manual/api/reference_commentary#data_types)|説明|
|--|--|------|
|**templateids**<br>(必須)|string/array|更新するテンプレートの ID。|
|groupids|string/array|特定のテンプレートを削除するホスト グループ。|
|macros|string/array|指定されたテンプレートから削除するユーザー マクロ。|
|templateids\_clear|string/array|指定されたテンプレート (上流) からリンクを解除してクリアするテンプレート。|
|templateids\_link|string/array|指定されたテンプレート (上流) からリンクを解除するテンプレート。|

[comment]: # ({/7ce45f78-bd7f8b44})

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

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

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

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

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

[comment]: # ({02a4a7dd-20c1ddc2})
#### グループからのテンプレートの削除

グループ"2"から 2 つのテンプレートを削除します

Request:

```json
{
    "jsonrpc": "2.0",
    "method": "template.massremove",
    "params": {
        "templateids": [
            "10085",
            "10086"
        ],
        "groupids": "2"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "templateids": [
            "10085",
            "10086"
        ]
    },
    "id": 1
}
```

[comment]: # ({/02a4a7dd-20c1ddc2})

[comment]: # ({7c6641ff-5ec690e5})
#### ホストからのテンプレートのリンク解除

テンプレート"10085"からテンプレート"10106"、"10104"のリンクを解除します。

Request:

```json
{
    "jsonrpc": "2.0",
    "method": "template.massremove",
    "params": {
        "templateids": "10085",
        "templateids_link": [
            "10106",
            "10104"
        ]
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "templateids": [
            "10085"
        ]
    },
    "id": 1
}
```

[comment]: # ({/7c6641ff-5ec690e5})

[comment]: # ({186aec66-186aec66})
### 参照

-   [template.update](update)
-   [User macro](/manual/api/reference/usermacro/object#hosttemplate_level_macro)

[comment]: # ({/186aec66-186aec66})

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

CTemplate::massRemove() in *ui/include/classes/api/services/CTemplate.php*.

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