[comment]: # translation:outdated

[comment]: # ({991d071b-991d071b})
# 删除历史数据

[comment]: # ({/991d071b-991d071b})

[comment]: # ({8a08a94c-3bf9d0da})
### 描述

`object history.clear(array itemids)`

这个方法用于删除监控项的历史数据。

::: noteclassic
这个方法只适用于*Admin*和*Super admin*用户类型。调用该方法的权限可以在用户角色设置中被撤销。 前往[用户角色](/manual/web_interface/frontend_sections/administration/user_roles)以了解更多信息。
:::

[comment]: # ({/8a08a94c-3bf9d0da})

[comment]: # ({f449cc26-f449cc26})

### 参数

`(array)`需要删除历史数据的监控项ID。

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

[comment]: # ({a59d9134-a59d9134})

### 返回值

`(object)` 返回一个包含 `itemids` 属性（其中包含成功删除历史数据的监控项ID）的对象。

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

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

### 示例

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

[comment]: # ({55bd96b5-e482fed3})
#### 删除历史数据

请求:

```json
{
    "jsonrpc": "2.0",
    "method": "history.clear",
    "params": [
        "10325",
        "13205"
    ],
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

响应:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "itemids": [
            "10325",
            "13205"
        ]
    },
    "id": 1
}
```

[comment]: # ({/55bd96b5-e482fed3})

[comment]: # ({e7aa34e8-e7aa34e8})

### 来源

*ui/include/classes/api/services/CHistory.php* 的 CHistory::clear()。

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