INSTALL In file /include/classes/api/API.php : Replace : 'webcheck' => 'CHttpTest' With : 'webcheck' => 'CHttpTest', 'valuemapping' => 'CValuemapping' Copy file CValuemapping.php in /api/classes/ directory USAGE GET : valuemapping.get valuemapids array Return only value mapping that belong to the given valuemapids. name string Return only value mapping that belong to the given name. with_mappings flag Return only valuemapping that have mappings and the mappings datas. filter object Return only those results that exactly match the given filter. Accepts an array, where the keys are property names, and the values are either a single value or an array of values to match against. search object Return results that match the given wildcard search. Accepts an array, where the keys are property names, and the values are strings to search for. If no additional options are given, this will perform a LIKE “%…%” search. Works only with text fields. sortfield string/array Sort the result by the given properties. Possible values are: valuemapid, name. countOutput flag These parameters being common for all get methods are described in detail in the reference commentary. editable boolean excludeSearch flag limit integer output query preservekeys flag searchByAny boolean searchWildcardsEnabled boolean sortorder string/array startSearch flag Examples Retrieving data by name Request: { "jsonrpc": "2.0", "method": "valuemapping.get", "params": { "output": "extend", "with_mappings" => true, "filter": { "name": [ "Windows service state", "Zabbix agent ping status" ] } }, "auth": "038e1d7b1735c6a5436ee9eae095879e", "id": 1 } Response: { "jsonrpc": "2.0", "result": [ { "valuemapid":"3", "name":"Windows service state", "mappings":[ { "mappingid":"33", "value":"0", "newvalue":"Running" }, { "mappingid":"34", "value":"1", "newvalue":"Paused" }, { "mappingid":"35", "value":"3", "newvalue":"Pause pending" }, { "mappingid":"36", "value":"4", "newvalue":"Continue pending" }, { "mappingid":"37", "value":"5", "newvalue":"Stop pending" }, { "mappingid":"38", "value":"6", "newvalue":"Stopped" }, { "mappingid":"39", "value":"7", "newvalue":"Unknown" }, { "mappingid":"40", "value":"255", "newvalue":"No such service" }, { "mappingid":"41", "value":"2", "newvalue":"Start pending" } ] }, { "valuemapid":"10", "name":"Zabbix agent ping status", "mappings":[ { "mappingid":"68", "value":"1", "newvalue":"Up" } ] } } Retrieving data by valuemapids Request: { "jsonrpc": "2.0", "method": "valuemapping.get", "params": { "valuemapids":[ "3", "10" ], "output": "extend" }, "auth": "038e1d7b1735c6a5436ee9eae095879e", "id": 1 } Response: { "jsonrpc": "2.0", "result": [ { "valuemapid":"3", "name":"Windows service state" }, { "valuemapid":"10", "name":"Zabbix agent ping status" } } CREATE : valuemapping.create name string Name of the value mapping mappings array Mapping Values by array : value=>10 newvalue=>"Converted value" Create new value mapping and corresponding mapping Request: { "jsonrpc":"2.0", "method":"valuemapping.create", "params":[ { "name":"test1", "mappings":[ { "value":"value1", "newvalue":"result1" }, { "value":"value2", "newvalue":"result2" } ] }, { "name":"test2", "mappings":[ { "value":"value3", "newvalue":"result3" } ] } ], "auth":"038e1d7b1735c6a5436ee9eae095879e", "id":"1" } Response: { "jsonrpc":"2.0", "result":{ "valuemapids":[ "53", "54" ] }, "id":"1" } DELETE: valuemapping.delete Request: { "jsonrpc":"2.0", "method":"valuemapping.delete", "params":[ 53, 54 ], "auth":"038e1d7b1735c6a5436ee9eae095879e", "id":"1" } Response: { "jsonrpc":"2.0", "result":{ "valuemapids":[ "53", "54" ] }, "id":"1" } UPDATE: valuemapping.update valuemapid string (Required) Id of the value mapping to update name string (Optionnal) New Name of the value mapping mappings array (Required) Mapping Values by array : "type":"remove", "mappingid":"236" or "type":"add", "value":"value45", "newvalue":"result45" Remove mappingid 236 and Add new mapping "value45" Request: { "jsonrpc":"2.0", "method":"valuemapping.update", "params":[ { "valuemapid":"53", "mappings":[ { "type":"remove", "mappingid":"236" }, { "type":"add", "value":"value45", "newvalue":"result45" } ] } ], "auth":"038e1d7b1735c6a5436ee9eae095879e", "id":"1" } Response: { "jsonrpc":"2.0", "result":{ "valuemapids":[ "53" ] }, "id":"1" } Changing Name Request: { "jsonrpc":"2.0", "method":"valuemapping.update", "params":[ { "valuemapid":"53", "name":"new Name test", "mappings":[] } ], "auth":"038e1d7b1735c6a5436ee9eae095879e", "id":"1" } Response: { "jsonrpc":"2.0", "result":{ "valuemapids":[ "53" ] }, "id":"1" }