> Media type object

The following objects are directly related to the mediatype API.

Media type

The media type object has the following properties.

PropertyTypeDescription
mediatypeidstring(readonly) ID of the media type.
name
(required)
stringName of the media type.
type
(required)
integerTransport used by the media type.

Possible values:
0 - email;
1 - script;
2 - SMS;
4 - Webhook.
exec_pathstringFor script media types exec_path contains the name of the executed script.

Required for script media types.
gsm_modemstringSerial device name of the GSM modem.

Required for SMS media types.
passwdstringAuthentication password.

Used for email media types.
smtp_emailstringEmail address from which notifications will be sent.

Required for email media types.
smtp_helostringSMTP HELO.

Required for email media types.
smtp_serverstringSMTP server.

Required for email media types.
smtp_portintegerSMTP server port to connect to.
smtp_securityintegerSMTP connection security level to use.

Possible values:
0 - None;
1 - STARTTLS;
2 - SSL/TLS.
smtp_verify_hostintegerSSL verify host for SMTP.

Possible values:
0 - No;
1 - Yes.
smtp_verify_peerintegerSSL verify peer for SMTP.

Possible values:
0 - No;
1 - Yes.
smtp_authenticationintegerSMTP authentication method to use.

Possible values:
0 - None;
1 - Normal password.
statusintegerWhether the media type is enabled.

Possible values:
0 - (default) enabled;
1 - disabled.
usernamestringUser name.

Used for email media types.
exec_paramsstringScript parameters.

Each parameter ends with a new line feed.
maxsessionsintegerThe maximum number of alerts that can be processed in parallel.

Possible values for SMS:
1 - (default)

Possible values for other media types:
0-100
maxattemptsintegerThe maximum number of attempts to send an alert.

Possible values:
1-100

Default value:
3
attempt_intervalstringThe interval between retry attempts. Accepts seconds and time unit with suffix.

Possible values:
0-1h

Default value:
10s
content_typeintegerMessage format.

Possible values:
0 - plain text;
1 - (default) html.
scriptstringMedia type webhook script javascript body.
timeoutstringMedia type webhook script timeout. Accepts seconds and time unit with suffix.

Possible values:
1-60s

Default value:
30s
process_tagsintegerDefines should the webhook script response to be interpreted as tags and these tags should be added to associated event.

Possible values:
0 - (default) Ignore webhook script response.
1 - Process webhook script response as tags.
show_event_menuintegerShow media type entry in problem.get and event.get property urls.

Possible values:
0 - (default) Do not add urls entry.
1 - Add media type to urls property.
event_menu_urlstringDefine url property of media type entry in urls property of problem.get and event.get.
event_menu_namestringDefine name property of media type entry in urls property of problem.get and event.get.
parametersarrayArray of webhook input parameters.
descriptionstringMedia type description.

Webhook parameters

Parameters passed to webhook script when it is called, have the following properties.

PropertyTypeDescription
name
(required)
stringParameter name.
valuestringParameter value, support macros. Supported macros described on page.

Message template

The message template object defines a template that will be used as a default message for action operations to send a notification. It has the following properties.

PropertyTypeDescription
eventsource
(required)
integerEvent source.

Possible values:
0 - triggers;
1 - discovery;
2 - autoregistration;
3 - internal;
4 - services.
recovery
(required)
integerOperation mode.

Possible values:
0 - operations;
1 - recovery operations;
2 - update operations.
subjectstringMessage subject.
messagestringMessage text.