manual:api:reference:valuemap:create

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:api:reference:valuemap:create [2020/05/05 09:38]
martins-v frontends/php -> ui (ZBX-17667)
manual:api:reference:valuemap:create [2021/05/05 14:13] (current)
gcalenko [ZBXNEXT-114,ZBXNEXT-6572] updated valuemap.create example
Line 5: Line 5:
  
 This method allows to create new value maps. This method allows to create new value maps.
 +
 +<​note>​This method is only available to //Super admin// user type. Permissions to call the method can be revoked in user role settings. See [[:​manual/​web_interface/​frontend_sections/​administration/​user_roles|User roles]] for more information.</​note>​
  
 ==== Parameters ==== ==== Parameters ====
 +
 ''​(object/​array)''​ Value maps to create. ''​(object/​array)''​ Value maps to create.
  
Line 25: Line 28:
     "​method":​ "​valuemap.create",​     "​method":​ "​valuemap.create",​
     "​params":​ {     "​params":​ {
 +        "​hostid":​ "​50009",​
         "​name":​ "​Service state",​         "​name":​ "​Service state",​
         "​mappings":​ [         "​mappings":​ [
             {             {
-                "value": "0", +                "type": "1",
-                "​newvalue":​ "​Down"​ +
-            }, +
-            {+
                 "​value":​ "​1",​                 "​value":​ "​1",​
                 "​newvalue":​ "​Up"​                 "​newvalue":​ "​Up"​
 +            },
 +            {
 +                "​type":​ "​5",​
 +                "​newvalue":​ "​Down"​
             }             }
         ]         ]