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.

ParameterTypeDescription
screenitemsarrayScreen items to be created for the screen.
usersarrayScreen user shares to be created on the screen.
userGroupsarrayScreen 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:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "screen.create",
  4. "params": {
  5. "name": "Graphs",
  6. "hsize": 3,
  7. "vsize": 2,
  8. "screenitems": [
  9. {
  10. "resourcetype": 0,
  11. "resourceid": "612",
  12. "rowspan": 1,
  13. "colspan": 1,
  14. "x": 0,
  15. "y": 0
  16. }
  17. ]
  18. },
  19. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  20. "id": 1
  21. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "screenids": [
  5. "26"
  6. ]
  7. },
  8. "id": 1
  9. }

Screen sharing

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

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "screen.create",
  4. "params": {
  5. "name": "Screen sharing",
  6. "hsize": 3,
  7. "vsize": 2,
  8. "users": [
  9. {
  10. "userid": "4",
  11. "permission": "3"
  12. }
  13. ],
  14. "userGroups": [
  15. {
  16. "usrgrpid": "7",
  17. "permission": "2"
  18. }
  19. ]
  20. },
  21. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  22. "id": 1
  23. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "screenids": [
  5. "83"
  6. ]
  7. },
  8. "id": 1
  9. }

See also

Source

CScreen::create() in ui/include/classes/api/services/CScreen.php.