Zabbix Documentation 4.0

2.23.04.04.2 (current)In development:4.4 (devel)Unsupported:1.82.02.43.23.4

User Tools

Site Tools


manual:api:reference:usermedia:get

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:api:reference:usermedia:get [2014/09/26 11:25]
sasha Links adapted because of a move operation
— (current)
Line 1: Line 1:
-===== usermedia.get ===== 
  
-==== Description ==== 
- 
-''​integer/​array usermedia.get(object **parameters**)''​ 
- 
-The method allows to retrieve media according to the given parameters. 
- 
-==== Parameters ==== 
- 
-''​(object)''​ Parameters defining the desired output. 
- 
-The method supports the following parameters. 
- 
-^ Parameter ^ Type ^ Description ^ 
-| mediaids | string/​array | Return only media with the given IDs. | 
-| usrgrpids | string/​array | Return only media that are used by users in the given user groups. | 
-| userids | string/​array | Return only media that are used by the given users. | 
-| mediatypeids | string/​array | Return only media that use the given media types. | 
-^ ||| 
-| sortfield | string/​array | Sort the result by the given properties. \\ \\ Possible values are: ''​mediaid'',​ ''​userid''​ and ''​mediatypeid''​. ​ | 
-| countOutput |flag|These parameters being common for all ''​get''​ methods are described in detail in the [[manual:​api:​reference_commentary#​common_get_method_parameters|reference commentary]]. ​ | 
-| editable |boolean|:::​| 
-| excludeSearch |flag|:::| 
-| filter | object |:::| 
-| limit |integer|:::​| 
-| output |query|:::| 
-| preservekeys |flag|:::| 
-| search | object |:::| 
-| searchByAny |boolean|:::​| 
-| searchWildcardsEnabled |boolean|:::​| 
-| sortorder | string/​array | ::: | 
-| startSearch |flag|:::| 
-==== Return values ==== 
- 
-''​(integer/​array)''​ Returns either: 
-  * an array of objects; 
-  * the count of retrieved objects, if the ''​countOutput''​ parameter has been used. 
- 
-==== Examples ==== 
- 
-=== Retrieving media by user === 
- 
-Retrieve all media for the given user. 
- 
-Request: 
-<code js> 
-{ 
-    "​jsonrpc":​ "​2.0",​ 
-    "​method":​ "​usermedia.get",​ 
-    "​params":​ { 
-        "​output":​ "​extend",​ 
-        "​userids":​ "​1"​ 
-    }, 
-    "​auth":​ "​038e1d7b1735c6a5436ee9eae095879e",​ 
-    "​id":​ 1 
-} 
-</​code>​ 
- 
-Response: 
-<code js> 
-{ 
-    "​jsonrpc":​ "​2.0",​ 
-    "​result":​ [ 
-        { 
-            "​mediaid":​ "​8",​ 
-            "​userid":​ "​1",​ 
-            "​mediatypeid":​ "​3",​ 
-            "​sendto":​ "​+3711231233",​ 
-            "​active":​ "​0",​ 
-            "​severity":​ "​48",​ 
-            "​period":​ "​1-5,​09:​00-18:​00"​ 
-        }, 
-        { 
-            "​mediaid":​ "​9",​ 
-            "​userid":​ "​1",​ 
-            "​mediatypeid":​ "​1",​ 
-            "​sendto":​ "​[email protected]",​ 
-            "​active":​ "​0",​ 
-            "​severity":​ "​63",​ 
-            "​period":​ "​1-7,​00:​00-24:​00"​ 
-        } 
-    ], 
-    "​id":​ 1 
-} 
-</​code>​ 
- 
-==== Source ==== 
- 
-CUserMedia::​get() in //​frontends/​php/​api/​classes/​CUserMedia.php//​.