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
       }
Copy
✔ Copied

响应:

{
           "jsonrpc": "2.0",
           "result": "4.0.0",
           "id": 1
       }
Copy
✔ Copied

来源

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
       }
Copy
✔ Copied

Response:

{
           "jsonrpc": "2.0",
           "result": "4.0.0",
           "id": 1
       }
Copy
✔ Copied

Source

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

To toggle search highlight, press Ctrl+Alt+H
Have an improvement suggestion for this page? Select the text that could be improved and press Ctrl+Enter to send it to the editors.