screen.get

Description

integer/array screen.get(object **parameters**)

The method allows to retrieve screens according to the given parameters.

This method is available to users of any type. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

ParameterTypeDescription
screenidsstring/arrayReturn only screens with the given IDs.
useridsstring/arrayReturn only screens that belong to the given user IDs.
screenitemidsstring/arrayReturn only screens that contain the given screen items.
selectScreenItemsqueryReturn a screenitems property with the elements that are used in the screen.
selectUsersqueryReturn a users property with users that the screen is shared with.
selectUserGroupsqueryReturn a userGroups property with user groups that the screen is shared with.
sortfieldstring/arraySort the result by the given properties.

Possible values are: screenid and name.
countOutputbooleanThese parameters being common for all get methods are described in detail in the reference commentary page.
editableboolean
excludeSearchboolean
filterobject
limitinteger
outputquery
preservekeysboolean
searchobject
searchByAnyboolean
searchWildcardsEnabledboolean
sortorderstring/array
startSearchboolean

Return values

(integer/array) Returns either:

  • an array of objects;

  • the count of retrieved objects, if the countOutput parameter has been used.

Examples

Retrieving a screen by ID

Retrieve all data about screen “26” and its screen items.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "screen.get",
  4. "params": {
  5. "output": "extend",
  6. "selectScreenItems": "extend",
  7. "selectUsers": "extend",
  8. "selectUserGroups": "extend",
  9. "screenids": "26"
  10. },
  11. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  12. "id": 1
  13. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": [
  4. {
  5. "screenitems": [
  6. {
  7. "screenitemid": "67",
  8. "screenid": "26",
  9. "resourcetype": "0",
  10. "resourceid": "612",
  11. "width": "320",
  12. "height": "200",
  13. "x": "0",
  14. "y": "0",
  15. "colspan": "0",
  16. "rowspan": "0",
  17. "elements": "25",
  18. "valign": "0",
  19. "halign": "0",
  20. "style": "0",
  21. "url": "",
  22. "dynamic": "0",
  23. "sort_triggers": "0"
  24. }
  25. ],
  26. "users": [
  27. {
  28. "sysmapuserid": "1",
  29. "userid": "2",
  30. "permission": "2"
  31. }
  32. ],
  33. "userGroups": [
  34. {
  35. "screenusrgrpid": "1",
  36. "usrgrpid": "7",
  37. "permission": "3"
  38. }
  39. ],
  40. "screenid": "26",
  41. "name": "CPU Graphs",
  42. "hsize": "3",
  43. "vsize": "2",
  44. "userid": "1",
  45. "private": "1"
  46. }
  47. ],
  48. "id": 1
  49. }

See also

Source

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