Zabbix Documentation 2.0

3.04.05.0 (current)| In development:5.2 (devel)| Unsupported:1.82.02.22.43.23.44.24.4Guidelines

User Tools

Site Tools


manual:appendix:api:screenitem:create

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Previous revision
manual:appendix:api:screenitem:create [2014/09/26 11:23]
manual:appendix:api:screenitem:create [2019/01/28 14:49] (current)
sasha <code js> => <code java>
Line 1: Line 1:
 +===== screenitem.create =====
  
 +==== Description ====
 +
 +''​object screenitem.create(object/​array **screenItems**)''​
 +
 +This method allows to create new screen items.
 +
 +==== Parameters ====
 +
 +''​(object/​array)''​ Screen items to create.
 +
 +The method accepts screen items with the [[definitions#​screen_item|standard screen item properties]].
 +
 +==== Return values ====
 +
 +''​(object)''​ Returns an object containing the IDs of the created screen items under the ''​screenitemids''​ property. The order of the returned IDs matches the order of the passed screen items.
 +
 +==== Examples ====
 +
 +=== Creating a screen item ===
 +
 +Create a screen item displaying a graph in the left-upper cell of the screen.
 +
 +Request:
 +<code java>
 +{
 +    "​jsonrpc":​ "​2.0",​
 +    "​method":​ "​screenitem.create",​
 +    "​params":​ {
 +        "​screenid":​ 16,
 +        "​resourcetype":​ 0,
 +        "​resourceid":​ 612,
 +        "​rowspan":​ 0,
 +        "​colspan":​ 0,
 +        "​x":​ 0,
 +        "​y":​ 0
 +    },
 +    "​auth":​ "​038e1d7b1735c6a5436ee9eae095879e",​
 +    "​id":​ 1
 +}
 +</​code>​
 +
 +Response:
 +<code java>
 +{
 +    "​jsonrpc":​ "​2.0",​
 +    "​result":​ {
 +        "​screenitemids":​ [
 +            "​65"​
 +        ]
 +    },
 +    "​id":​ 1
 +}
 +</​code>​
 +
 +==== See also ====
 +
 +  * [[manual:​appendix:​api:​screen:​update|screen.update]]
 +
 +==== Source ====
 +
 +CScreenItem::​create() in //​frontends/​php/​api/​classes/​CScreenItem.php//​.