Zabbix Documentation 4.0

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


Sidebar

zh:manual:api:reference:apiinfo:version

apiinfo.version

说明

string apiinfo.version(array)

该方法用于获取 Zabbix API 版本。

参数

此方法可用于未经身份验证的用户,必须在发送 JSON-RPC 请求中不加auth参数的情况下调用。

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

返回值

(string) 返回 Zabbix API 的版本。

从 Zabbix 2.0.4 版本开始,API 的版本与 Zabbix 的版本相匹配。

范例

获取 API 版本

获取 Zabbix API 版本。

请求:

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

响应:

{
    "jsonrpc": "2.0",
    "result": "4.0.0",
    "id": 1
}

来源

CAPIInfo::version() in frontends/php/include/classes/api/services/CAPIInfo.php.

Description

string apiinfo.version(array)

This method allows to retrieve the version of the Zabbix API.

Parameters

This method is available to unauthenticated users and must be called without the auth parameter in the JSON-RPC request.

(array) The method accepts an empty array.

Return values

(string) Returns the version of the Zabbix API.

Starting from Zabbix 2.0.4 the version of the API matches the version of Zabbix.

Examples

Retrieving the version of the API

Retrieve the version of the Zabbix API.

Request:

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

Response:

{
    "jsonrpc": "2.0",
    "result": "4.0.0",
    "id": 1
}

Source

CAPIInfo::version() in frontends/php/include/classes/api/services/CAPIInfo.php.