integer/array itemprototype.get(object parameters)
The method allows to retrieve item prototypes according to the given parameters.
(object) Parameters defining the desired output.
The method supports the following parameters.
| Parameter | Type | Description | 
|---|---|---|
| discoveryids | string/array | Return only item prototypes that belong to the given LLD rules. | 
| graphids | string/array | Return only item prototypes that are used in the given graph prototypes. | 
| hostids | string/array | Return only item prototypes that belong to the given hosts. | 
| inherited | boolean | If set to truereturn only item prototypes inherited from a template. | 
| itemids | string/array | Return only item prototypes with the given IDs. | 
| monitored | boolean | If set to truereturn only enabled item prototypes that belong to monitored hosts. | 
| templated | boolean | If set to truereturn only item prototypes that belong to templates. | 
| templateids | string/array | Return only item prototypes that belong to the given templates. | 
| triggerids | string/array | Return only item prototypes that are used in the given trigger prototypes. | 
| selectApplications | query | Return applications that the item prototype belongs to in the applicationsproperty. | 
| selectApplicationPrototypes | query | Return application prototypes linked to item prototype in applicationPrototypesproperty. | 
| selectDiscoveryRule | query | Return the low-level discovery rule that the item prototype belongs to in the discoveryRuleproperty. | 
| selectGraphs | query | Return graph prototypes that the item prototype is used in in the graphsproperty.Supports count. | 
| selectHosts | query | Returns the host that the item prototype belongs to as an array in the hostsproperty. | 
| selectTriggers | query | Return trigger prototypes that the item prototype is used in in the triggersproperty.Supports count. | 
| filter | object | Return only those results that exactly match the given filter. Accepts an array, where the keys are property names, and the values are either a single value or an array of values to match against. Supports additional filters: host- technical name of the host that the item prototype belongs to. | 
| limitSelects | integer | Limits the number of records returned by subselects. Applies to the following subselects: selectGraphs- results will be sorted byname;selectTriggers- results will be sorted bydescription. | 
| sortfield | string/array | Sort the result by the given properties. Possible values are: itemid,name,key_,delay,typeandstatus. | 
| countOutput | flag | These parameters being common for all getmethods are described in detail in the reference commentary. | 
| editable | boolean | |
| excludeSearch | flag | |
| limit | integer | |
| output | query | |
| preservekeys | flag | |
| search | object | |
| searchByAny | boolean | |
| searchWildcardsEnabled | boolean | |
| sortorder | string/array | |
| startSearch | flag | 
(integer/array) Returns either:
countOutput parameter has been used.Retrieve all item prototypes from an LLD rule.
Request:
{
           "jsonrpc": "2.0",
           "method": "itemprototype.get",
           "params": {
               "output": "extend",
               "discoveryids": "27426"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }Response:
{
           "jsonrpc": "2.0",
           "result": [
               {
                   "itemid": "27427",
                   "type": "0",
                   "snmp_community": "",
                   "snmp_oid": "",
                   "hostid": "10202",
                   "name": "Incoming network traffic on $1 23",
                   "key_": "2net.if.in[{#IFNAME}]",
                   "delay": "60",
                   "history": "7",
                   "trends": "365",
                   "status": "0",
                   "value_type": "3",
                   "trapper_hosts": "",
                   "units": "bps",
                   "multiplier": "1",
                   "delta": "1",
                   "snmpv3_securityname": "",
                   "snmpv3_securitylevel": "0",
                   "snmpv3_authpassphrase": "",
                   "snmpv3_privpassphrase": "",
                   "formula": "8",
                   "logtimefmt": "",
                   "templateid": "23881",
                   "valuemapid": "0",
                   "delay_flex": "",
                   "params": "",
                   "ipmi_sensor": "",
                   "data_type": "0",
                   "authtype": "0",
                   "username": "",
                   "password": "",
                   "publickey": "",
                   "privatekey": "",
                   "mtime": "0",
                   "filter": "",
                   "interfaceid": "119",
                   "port": "",
                   "description": "",
                   "snmpv3_authprotocol": "0",
                   "snmpv3_privprotocol": "0"
               },
               {
                   "itemid": "27428",
                   "type": "0",
                   "snmp_community": "",
                   "snmp_oid": "",
                   "hostid": "10202",
                   "name": "Incoming network traffic on $1",
                   "key_": "net.if.in[{#IFNAME}]",
                   "delay": "60",
                   "history": "7",
                   "trends": "365",
                   "status": "0",
                   "value_type": "3",
                   "trapper_hosts": "",
                   "units": "bps",
                   "multiplier": "1",
                   "delta": "1",
                   "snmpv3_securityname": "",
                   "snmpv3_securitylevel": "0",
                   "snmpv3_authpassphrase": "",
                   "snmpv3_privpassphrase": "",
                   "formula": "8",
                   "logtimefmt": "",
                   "templateid": "22446",
                   "valuemapid": "0",
                   "delay_flex": "",
                   "params": "",
                   "ipmi_sensor": "",
                   "data_type": "0",
                   "authtype": "0",
                   "username": "",
                   "password": "",
                   "publickey": "",
                   "privatekey": "",
                   "mtime": "0",
                   "filter": "",
                   "interfaceid": "119",
                   "port": "",
                   "description": "",
                   "snmpv3_authprotocol": "0",
                   "snmpv3_privprotocol": "0"
               }
           ],
           "id": 1
       }CItemPrototype::get() in frontends/php/include/classes/api/services/CItemPrototype.php.