[comment]: # ({34f25b55-34f25b55})
# 版本

[comment]: # ({/34f25b55-34f25b55})

[comment]: # ({425f6e3f-bc32199a})
### 描述

`string apiinfo.version(array)`

此方法用于获取 Zabbix API 的版本。

::: noteimportant
此方法仅对未认证用户可用。
:::

[comment]: # ({/425f6e3f-bc32199a})

[comment]: # ({4fa8a419-4fa8a419})
### 参数

`(array)` 该方法接受一个空数组。

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

[comment]: # ({53521d11-53521d11})
### 返回值

`(string)` 返回Zabbix API的版本。

::: notetip
从Zabbix 2.0.4开始，API的版本与Zabbix的版本相匹配。
:::

[comment]: # ({/53521d11-53521d11})

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

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

[comment]: # ({e03a5558-6ba4bdd0})
#### 获取 API 的版本

获取 Zabbix API 的版本。

[请求](/manual/api#performing-requests)：

```json
{
    "jsonrpc": "2.0",
    "method": "apiinfo.version",
    "params": [],
    "id": 1
}
```

响应：

```json
{
    "jsonrpc": "2.0",
    "result": "8.0.0",
    "id": 1
}
```

[comment]: # ({/e03a5558-6ba4bdd0})

[comment]: # ({25499b5e-25499b5e})
### 源码位置

CAPIInfo::version() 在 *ui/include/classes/api/services/CAPIInfo.php* 文件中。

[comment]: # ({/25499b5e-25499b5e})
