Zabbix Documentation 1.8

3.04.04.45.0 (current)| In development:5.2 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


api:mediatype:get

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
api:mediatype:get [2014/09/26 11:23]
api:mediatype:get [2019/01/28 14:45] (current)
sasha <code js> => <code java>
Line 1: Line 1:
 +===== get() =====
 +Available since version: **1.8**\\
 +This function allows you to retrieve mediatype details based on filtering options.
 +All parameters are optional. If parameter is set in query this option counted as ON, except if parameter is equal to NULL.
 +====Parameters====
 +^Parameter^Type^Description^Details^
 +|**nodeids**|//​array//​|Node IDs | |
 +|**userids**|//​array//​|User IDs | |
 +|**mediaids**|//​array//​|User media IDs | |
 +|**mediatypeids**|//​array//​|Mediatype IDs | |
 +|**editable**|//​integer//​|only with read-write permission. Ignored for SuperAdmins | |
 +|**filter**|//​array//​|Optional filter by mediatype fields| |
 +|**search**|//​string//​|Return mediatypes by given mediatype fields pattern | |
 +|**startSearch**|//​integer//​|Search given patterns only in start of the field  | |
 +|**excludeSearch**|//​integer//​|Exclude from result mediatypes by given patterns | |
 +|**searchWildcardsEnabled**|//​integer//​|Search pattern in whole field using wildcards | 1 - enable, 0 - disable|
 +|**output**|//​string//​|Output options | Values: shorten, refer, extend|
 +|**select_users**|//​string//​|Select users| Values: shorten, refer, extend|
 +|**select_medias**|//​string//​|Select user media| Values: shorten, refer, extend|
 +|**countOutput**|//​integer//​|Count mediatypes, returned the number of mediatypes found | |
 +|**groupCount**|//​integer//​|Return the number of results grouped by given IDs | |
 +|**preservekeys**|//​integer//​|Return hash instead of array |Keys of hash are object IDs |
 +|**sortfield**|//​string//​|Sort by mediatype field |Values: mediatypeid |
 +|**sortorder**|//​string//​|Sort order | Values: ASC, DESC|
 +|**limit**|//​int//​|max number mediatype of objects to return | |
  
 +====Returns====
 +^Parameter ^Description^
 +|**result**|Operation successful. Result will contain array of Mediatype objects.|
 +|**error** |In case of any errors|
 +
 +==== Example ====
 +
 +Get mediatypes details by mediatype description pattern "​sms"​ and limit output to 1 mediatype, return full **mediatype** object:
 +<code java>
 +{
 +"​jsonrpc":​ "​2.0",​
 +"​method":​ "​mediatype.get",​
 +"​params":​ {
 + "​search":​ {"​description":​ "​sms"​},​
 + "​output":​ "​extend",​
 +},
 +"​auth":​ "​6f38cddc44cfbb6c1bd186f9a220b5a0",​
 +"​id":​ 2
 +}
 +</​code>​
 +
 +Retrieved mediatypes details:
 +
 +<code java>
 +{
 +"​jsonrpc":​ "​2.0",​
 +"​result":​ [{
 + "​mediatypeid":​ "​100100000000003",​
 + "​type":​ "​2",​
 + "​description":​ "​SMS",​
 + "​smtp_server":​ "",​
 + "​smtp_helo":​ "",​
 + "​smtp_email":​ "",​
 + "​exec_path":​ "",​
 + "​gsm_modem":​ "​\/​dev\/​ttyS0",​
 + "​username":​ "",​
 + "​passwd":​ ""​
 +}],
 +"​id":​ 2
 +}
 +</​code>​