Configuring SMTP by using the REST API
You can set up and modify the SMTP configuration using the /admin/smtp endpoint. The equivalent manual procedure is described in Configuring-mail-settings.
To modify an SMTP configuration
GET the current SMTP configuration. Use the GET/admin/smtp endpoint. The endpoint returns JSON formatted data:
{
"enabled": false, // enable or disable sending email from BMC Discovery
"from_addr": "", // address from which to send the email
"server": "", // IP address or resolvable name of the SMTP server
"port": 25, // port number on which to contact the SMTP server
"auth_required": false, // authentication required
"username": "", // username with which to log in to the SMTP server
"sec_connection": "none" // type of authentication
// none - no authentication
// STARTTLS
// SSL/TLS
}Modify the returned JSON to reflect the state of the SMTP configuration you require. for example:
{
"enabled": true, // enable or disable sending email from BMC Discovery
"from_addr": "discovery@customer.com", // address from which to send the email
"server": "smtp.customer.com", // IP address or resolvable name of the SMTP server
"port": 25, // port number on which to contact the SMTP server
"auth_required": true, // authentication required
"username": "discoadmin", // username with which to log in to the SMTP server
"sec_connection": "SSL/TLS" // type of authentication
// none - no authentication
// STARTTLS
// SSL/TLS
}- To apply the changes, use the PATCH/admin/smtp endpoint.
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*