Mail Server Configuration APIs


Mail Server API allows the user to view mail server details and configure mail server parameters in Applications Manager. These APIs allow an admin user to configure the mail server to send e-mail to specified persons in the event of an alarm. This API is designed to support GET and POST requests.

Supported HTTP methods: GET, POST

Allowed roles: Administrator

GET Request

Whenever the request is sent by "GET" method, the data corresponding to the API will be listed.

Sample Request

https://[HOST]:[PORT]/AppManager/xml/MailServer?apikey=[apikey]

POST Request

When the request is sent by "POST" method, the corresponding data will be added/updated.

Sample Request

https://[HOST]:[PORT]/AppManager/xml/MailServer?apikey=[apikey]

Request Parameters

The parameters involved in the API request are described below:

For Primary Server:

Field Description Is Mandatory
primaryProtocol Should be SMTP or EWS Yes
primaryAuthType Should be Basic or OAuth Yes
smtpServer The Server IP or host name of the host in which the SMTP server runs. Mandatory, if primaryProtocol is SMTP
smtpPort The SMTP port number. Mandatory, if primaryProtocol is SMTP
smtpEmail The email address available in that Mail server. Yes
smtpUserName User name for authentication -
smtpPassword Password for authentication -
prmTlsAuth Primary Tls Authentication. The value can be either true or false. -
prmSslAuth Primary SSL Authentication. The value can be either true or false. -
primaryOAuthProvider OAuth Provider ID for OAuth configuration. Mandatory, if primaryAuthType is OAuth
primaryURL Connection URL for EWS (Exchange server). Mandatory, if primaryProtocol is EWS

For Secondary Server:

Field Description Is Mandatory
secondaryProtocol Should be SMTP or EWS Yes
secondaryAuthType Should be Basic or OAuth Yes
secSmtpServer The Server IP or host name of the host in which the SMTP server runs. Mandatory, if secondaryProtocol is SMTP
secSmtpPort The SMTP port number. Mandatory, if secondaryProtocol is SMTP
secSmtpEmail The email address available in that Mail server. Yes
secSmtpUserName Username for authentication. -
secSmtpPassword Password for authentication. -
secTlsAuth Secondary Tls Authentication. The value can be either true or false. -
secSslAuth Secondary SSL Authentication. The value can be either true or false. -
secondaryOAuthProvider OAuth Provider ID for OAuth configuration. Mandatory, if primaryAuthType is OAuth
secondaryURL Connection URL for EWS (Exchange server). Mandatory, if primaryProtocol is EWS

SMTP with Basic Authentication type in XML:

https://[HOST]:[PORT]/AppManager/xml/MailServer?apikey=[ API Key ]&primaryProtocol=[ SMTP ]&primaryAuthType=[ Basic ]&smtpPort=[ Port ]&smtpUserName=[ Username]&smtpPassword=[ Password ]&smtpServer=[ Server Name ]&smtpEmail=[ Email Address ]&prmTlsAuth=[ true ]&prmSslAuth=[ True/False ]&fromAdminServer=[ True/False ]&secondaryProtocol=[ SMTP ]&secondaryAuthType=[ Basic ]&secSmtpPort=[ Secondary Port ]&secSmtpEmail=[ Email Address ]&secSmtpUserName=[ user Name ]&secSmtpServer=[ Secondary Server Name ]&secSmtpPassword=[ Password ]&secSslAuth=[ True/False ]&secTlsAuth=[ True/False ]

EWS with OAuth Authentication type in XML:

https://[HOST]:[PORT]/AppManager/xml/MailServer?apikey=[ API Key ]&primaryProtocol=[ EWS ]&primaryAuthType=[ OAuth ]&smtpEmail=[ Email Address ]&primaryOAuthProvider=[ OAuth Provider ID ]&primaryURL=[ Connection URL ]&fromAdminServer=[ True/False ]&secondaryProtocol=[ SMTP ]&secondaryAuthType=[ Basic ]&secSmtpPort=[ Secondary Port ]&secSmtpEmail=[ Email Address ]&secSmtpUserName=[ user Name ]&secSmtpPassword=[ Password ]&secSmtpServer=[ Secondary Server Name ]&secSslAuth=[ True/False ]&secTlsAuth=[ True/False ]

SMTP with OAuth Authentication type in JSON:

https://[HOST]:[PORT]/AppManager/json/MailServer?apikey=[ API Key ]&primaryProtocol=[ SMTP ]&primaryAuthType=[ OAuth ]&smtpPort=[ Port ]&primaryOAuthProvider=[ OAuth Provider ID ]&smtpServer=[ Server Name ]&prmTlsAuth=[ True ]&smtpEmail=[ Email Address ]&fromAdminServer=[ True/False ]&secondaryProtocol=[ SMTP ]secondaryAuthType=[ OAuth ]&secTlsAuth=[ True/False ]&secSmtpPort=[ Secondary Port ]&secSmtpEmail=[ Email Address ]&secSmtpServer=[ Secondary Server Name ]&secondaryOAuthProvider=[ OAuth Provider ID ]

EWS with OAuth Authentication type in JSON:

https://[HOST]:[PORT]/AppManager/json/MailServer?apikey=[ API Key ]&primaryProtocol=[ EWS ]&primaryAuthType=[ OAuth ]&primaryOAuthProvider=[ OAuth Provider ID ]&primaryURL=[ Connection URL ]&smtpEmail=[ Email Address ]&fromAdminServer=[ True/False ]&secondaryProtocol=[ EWS ]secondaryAuthType=[ OAuth ]&secSmtpEmail=[ Email Address ]&secondaryOAuthProvider=[ OAuth Provider ID ]&secondaryURL=[ Connection URL ]

Example

https://apm-prod-server:8443/AppManager/xml/MailServer?apikey=aaaaaabbbbbbccccccddddddeeeeee&primaryProtocol=SMTP&primaryAuthType=Basic&smtpPort=25&smtpEmail=mailid@appmanager.com&smtpServer=smtp&prmTlsAuth=true&prmSslAuth=true&&smtpUserName=priadmin&smtpPassword=priappman&SslAuth=true&fromAdminServer=true&secTlsAuth=true&secondaryProtocol=smtp&secondaryOAuthProvider=Basic&secSmtpPort=25&secSmtpEmail=mailid@domain.com&secSmtpUserName=secadmin&secSmtpServer=smtp&secSmtpPassword=secappman