This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

screen.create

Description

object screen.create(object/array screens)

This method allows to create new screens.

Parameters

(object/array) Screens to create.

Additionally to the standard screen properties, the method accepts the following parameters.

Parameter Type Description
screenitems array Screen items to be created for the screen.
users array Screen user shares to be created on the screen.
userGroups array Screen user group shares to be created on the screen.

Return values

(object) Returns an object containing the IDs of the created screens under the screenids property. The order of the returned IDs matches the order of the passed screens.

Examples

Creating a screen

Create a screen named "Graphs" with 2 rows and 3 columns and add a graph to the upper-left cell.

Request:

{
           "jsonrpc": "2.0",
           "method": "screen.create",
           "params": {
               "name": "Graphs",
               "hsize": 3,
               "vsize": 2,
               "screenitems": [
                   {
                       "resourcetype": 0,
                       "resourceid": "612",
                       "rowspan": 0,
                       "colspan": 0,
                       "x": 0,
                       "y": 0
                   }
               ]
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }
Copy
✔ Copied

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "screenids": [
                   "26"
               ]
           },
           "id": 1
       }
Copy
✔ Copied

Screen sharing

Create a screen with two types of sharing (user and user group).

Request:

{
           "jsonrpc": "2.0",
           "method": "screen.create",
           "params": {
               "name": "Screen sharing",
               "hsize": 3,
               "vsize": 2,
               "users": [
                   {
                       "userid": "4",
                       "permission": "3"
                   }
               ],
               "userGroups": [
                   {
                       "usrgrpid": "7",
                       "permission": "2"
                   }
               ]
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }
Copy
✔ Copied

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "screenids": [
                   "83"
               ]
           },
           "id": 1
       }
Copy
✔ Copied

See also

Source

CScreen::create() in frontends/php/include/classes/api/services/CScreen.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.