templatescreenitem.get

Description

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

The method allows to retrieve template screen items according to the given parameters.

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

ParameterTypeDescription
screenidsstring/arrayReturn only template screen items that belong to the given template screens.
screenitemidsstring/arrayReturn only template screen items with the given IDs.
hostidsstring/arrayReturns an additional real_resourceid property for each template screen item, that belongs to a screen from the given hosts or templates. The real_resourceid property contains the ID of object displayed on the screen.
sortfieldstring/arraySort the result by the given properties.

Possible values are: screenitemid and screenid.
countOutputbooleanThese parameters being common for all get methods are described in detail in the reference commentary.
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

Retrieve template screen items for screen

Return all template screen items from template screen “15”.

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "templatescreenitem.get",
  4. "params": {
  5. "output": "extend",
  6. "screenids": "15"
  7. },
  8. "auth": "038e1d7b1735c6a5436ee9eae095879e",
  9. "id": 1
  10. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": [
  4. {
  5. "screenitemid": "42",
  6. "screenid": "15",
  7. "resourcetype": "0",
  8. "resourceid": "454",
  9. "width": "500",
  10. "height": "200",
  11. "x": "0",
  12. "y": "0",
  13. "colspan": "1",
  14. "rowspan": "1",
  15. "elements": "0",
  16. "valign": "1",
  17. "halign": "0",
  18. "style": "0",
  19. "url": "",
  20. "max_columns": "3"
  21. },
  22. {
  23. "screenitemid": "43",
  24. "screenid": "15",
  25. "resourcetype": "0",
  26. "resourceid": "455",
  27. "width": "500",
  28. "height": "270",
  29. "x": "1",
  30. "y": "0",
  31. "colspan": "1",
  32. "rowspan": "1",
  33. "elements": "0",
  34. "valign": "1",
  35. "halign": "0",
  36. "style": "0",
  37. "url": "",
  38. "max_columns": "3"
  39. }
  40. ],
  41. "id": 1
  42. }

Source

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