Zabbix Documentation 1.8

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


Sidebar

api:mediatype:get

Table of Contents

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

ParameterTypeDescriptionDetails
nodeidsarrayNode IDs
useridsarrayUser IDs
mediaidsarrayUser media IDs
mediatypeidsarrayMediatype IDs
editableintegeronly with read-write permission. Ignored for SuperAdmins
filterarrayOptional filter by mediatype fields
searchstringReturn mediatypes by given mediatype fields pattern
startSearchintegerSearch given patterns only in start of the field
excludeSearchintegerExclude from result mediatypes by given patterns
searchWildcardsEnabledintegerSearch pattern in whole field using wildcards 1 - enable, 0 - disable
outputstringOutput options Values: shorten, refer, extend
select_usersstringSelect users Values: shorten, refer, extend
select_mediasstringSelect user media Values: shorten, refer, extend
countOutputintegerCount mediatypes, returned the number of mediatypes found
groupCountintegerReturn the number of results grouped by given IDs
preservekeysintegerReturn hash instead of array Keys of hash are object IDs
sortfieldstringSort by mediatype field Values: mediatypeid
sortorderstringSort order Values: ASC, DESC
limitintmax number mediatype of objects to return

Returns

Parameter Description
resultOperation 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:

{
"jsonrpc": "2.0",
"method": "mediatype.get",
"params": {
	"search": {"description": "sms"},
	"output": "extend",
},
"auth": "6f38cddc44cfbb6c1bd186f9a220b5a0",
"id": 2
}

Retrieved mediatypes details:

{
"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
}