boolean configuration.import(object parameters)
This method allows to import configuration data from a serialized string.
This method is available to users of any type. Permissions to call the method can be revoked in user role settings. See User roles for more information.
(object) Parameters containing the data to import and rules how the data should be handled.
| Parameter | Type | Description | 
|---|---|---|
| format (required) | string | Format of the serialized string. Possible values: yaml- YAML;xml- XML;json- JSON. | 
| source (required) | string | Serialized string containing the configuration data. | 
| rules (required) | object | Rules on how new and existing objects should be imported. The rulesparameter is described in detail in the table below. | 
If no rules are given, the configuration will not be updated.
The rules object supports the following parameters.
| Parameter | Type | Description | 
|---|---|---|
| discoveryRules | object | Rules on how to import LLD rules. Supported parameters: createMissing-(boolean)if set totrue, new LLD rules will be created; default:false;updateExisting-(boolean)if set totrue, existing LLD rules will be updated; default:false;deleteMissing-(boolean)if set totrue, LLD rules not present in the imported data will be deleted from the database; default:false. | 
| graphs | object | Rules on how to import graphs. Supported parameters: createMissing-(boolean)if set totrue, new graphs will be created; default:false;updateExisting-(boolean)if set totrue, existing graphs will be updated; default:false;deleteMissing-(boolean)if set totrue, graphs not present in the imported data will be deleted from the database; default:false. | 
| groups | object | Rules on how to import host groups. Supported parameters: createMissing-(boolean)if set totrue, new host groups will be created; default:false;updateExisting-(boolean)if set totrue, existing host groups will be updated; default:false. | 
| hosts | object | Rules on how to import hosts. Supported parameters: createMissing-(boolean)if set totrue, new hosts will be created; default:false;updateExisting-(boolean)if set totrue, existing hosts will be updated; default:false. | 
| httptests | object | Rules on how to import web scenarios. Supported parameters: createMissing-(boolean)if set totrue, new web scenarios will be created; default:false;updateExisting-(boolean)if set totrue, existing web scenarios will be updated; default:false;deleteMissing-(boolean)if set totrue, web scenarios not present in the imported data will be deleted from the database; default:false. | 
| images | object | Rules on how to import images. Supported parameters: createMissing-(boolean)if set totrue, new images will be created; default:false;updateExisting-(boolean)if set totrue, existing images will be updated; default:false. | 
| items | object | Rules on how to import items. Supported parameters: createMissing-(boolean)if set totrue, new items will be created; default:false;updateExisting-(boolean)if set totrue, existing items will be updated; default:false;deleteMissing-(boolean)if set totrue, items not present in the imported data will be deleted from the database; default:false. | 
| maps | object | Rules on how to import maps. Supported parameters: createMissing-(boolean)if set totrue, new maps will be created; default:false;updateExisting-(boolean)if set totrue, existing maps will be updated; default:false. | 
| mediaTypes | object | Rules on how to import media types. Supported parameters: createMissing-(boolean)if set totrue, new media types will be created; default:false;updateExisting-(boolean)if set totrue, existing media types will be updated; default:false. | 
| templateLinkage | object | Rules on how to import template links. Supported parameters: createMissing-(boolean)if set totrue, new links between templates and host will be created; default:false;deleteMissing-(boolean)if set totrue, template links not present in the imported data will be deleted from the database; default:false. | 
| templates | object | Rules on how to import templates. Supported parameters: createMissing-(boolean)if set totrue, new templates will be created; default:false;updateExisting-(boolean)if set totrue, existing templates will be updated; default:false. | 
| templateDashboards | object | Rules on how to import template dashboards. Supported parameters: createMissing-(boolean)if set totrue, new template dashboards will be created; default:false;updateExisting-(boolean)if set totrue, existing template dashboards will be updated; default:false;deleteMissing-(boolean)if set totrue, template dashboards not present in the imported data will be deleted from the database; default:false. | 
| triggers | object | Rules on how to import triggers. Supported parameters: createMissing-(boolean)if set totrue, new triggers will be created; default:false;updateExisting-(boolean)if set totrue, existing triggers will be updated; default:false;deleteMissing-(boolean)if set totrue, triggers not present in the imported data will be deleted from the database; default:false. | 
| valueMaps | object | Rules on how to import host or template value maps. Supported parameters: createMissing-(boolean)if set totrue, new value maps will be created; default:false;updateExisting-(boolean)if set totrue, existing value maps will be updated; default:false;deleteMissing-(boolean)if set totrue, value maps not present in the imported data will be deleted from the database; default:false. | 
(boolean) Returns true if importing has been successful.
Import the host and items contained in the XML string. If any items in XML are missing, they will be deleted from the database, and everything else will be left unchanged.
Request:
{
           "jsonrpc": "2.0",
           "method": "configuration.import",
           "params": {
               "format": "xml",
               "rules": {
                   "valueMaps": {
                       "createMissing": true,
                       "updateExisting": false
                   },
                   "hosts": {
                       "createMissing": true,
                       "updateExisting": true
                   },
                   "items": {
                       "createMissing": true,
                       "updateExisting": true,
                       "deleteMissing": true
                   }
               },
               "source": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<zabbix_export><version>5.4</version><date>2020-03-13T15:31:45Z</date><groups><group><uuid>6f6799aa69e844b4b3918f779f2abf08</uuid><name>Zabbix servers</name></group></groups><hosts><host><host>Export host</host><name>Export host</name><groups><group><name>Zabbix servers</name></group></groups><interfaces><interface><interface_ref>if1</interface_ref></interface></interfaces><items><item><name>Item</name><key>item.key</key><delay>30s</delay><valuemap><name>Host status</name></valuemap><interface_ref>if1</interface_ref><request_method>POST</request_method></item></items><valuemaps><valuemap><name>Host status</name><mappings><mapping><value>0</value><newvalue>Up</newvalue></mapping><mapping><value>2</value><newvalue>Unreachable</newvalue></mapping></mappings></valuemap></valuemaps></host></hosts></zabbix_export>"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }Response:
CConfiguration::import() in ui/include/classes/api/services/CConfiguration.php.