Enabling Notification Settings
This section explains how to enable notification settings.
Request
PUT https://<hostname>/api/v1/settings/emailNotifications |
Request Headers
The request header must contain an authorization token of the current session.
Request Parameters
None.
Request Body
Property | Type | Description |
|---|---|---|
smtpSettings | Contains the SmtpSettings object. | |
notificationsEnabled | boolean | Defines if the email notifications are enabled. |
from | string | Sets the sender address. |
to | string | Sets the recipient address. |
subject | string | Sets the subject. |
dailyReportSettings | Contains the DailyReportSettings object. | |
emailNotificationSettings | Contains the EventEmailNotificationSettings object. |
Property | Type | Description |
|---|---|---|
accountId | integet | Sets the identification number of the standard account that is used for authentication on the SMTP server. Can be obtained as described in Getting Standard Accounts. |
host | string | Sets the name of the SMTP server. |
port | integer | Sets the port number of the SMTP server. |
useSecureConnection | boolean | Sets if a secure connection is enabled. |
timeOutMiliSeconds | integer | Sets the timeout value. |
Property | Type | Description |
|---|---|---|
sendDailyReport | boolean | Defines if a daily report must be sent at the specified time. |
dailyTime | string | Defines when to send a daily report. |
EventEmailNotificationSettings Object
Property | Type | Description |
|---|---|---|
notifyOnSuccess | boolean | Sets if a notification must be sent on each Success session of a backup policy. |
notifyOnWarning | boolean | Sets if a notification must be sent on each Warning session of a backup policy. |
notifyOnFailure | boolean | Sets if a notification must be sent on each Failure session of a backup policy. |
Request Example
Request: PUT https://abc.ukwest.cloudapp.azure.com/api/v1/settings/emailNotifications
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "smtpSettings": { "accountId" : 1, "host": "gamma.tech.local", "port": 25, "useSecureConnection": true, "timeOutMiliSeconds": 100000 }, "notificationsEnabled": true, "from": "administrator@tech.local", "to": "group@.com", "subject": "[%JobResult%] %JobName% (%VmCount% virtual machines) %Issues%", "dailyReportSettings": { "sendDailyReport": true, "dailyTime": "00:00:00" }, "emailNotificationSettings": { "notifyOnSuccess": true, "notifyOnWarning": false, "notifyOnFailure": true } } |
Response
The server returns the following response to the client.
Response Codes
A successfully completed operation returns a response code 200 (OK).
Response Headers
The response to this request contains the following headers. The response may also include additional standard HTTPS headers.
Header | Description |
Content-length | The length of the response body. |
Content-type | The media type and syntax of the response body message: application/json; charset=utf-8 |
Response Body
Property | Type | Description |
|---|---|---|
smtpSettings | Contains the SmtpSettings object. | |
notificationsEnabled | boolean | Shows if the email notifications are enabled. |
from | string | Shows the sender address. |
to | string | Shows the recipient address. |
subject | string | Shows the subject. |
dailyReportSettings | Contains the DailyReportSettings object. | |
emailNotificationSettings | Contains the EventEmailNotificationSettings object. |
Property | Type | Description |
|---|---|---|
account | Contains the StandardAccount object. | |
host | string | Shows the name of the SMTP server. |
port | integer | Shows the port number of the SMTP server. |
useSecureConnection | boolean | Shows if a secure connection is enabled. |
timeOutMiliSeconds | integer | Shows the timeout value. |
Property | Type | Description |
|---|---|---|
id | integer | Shows the identification number if the standard account that is used to for authentication on the SMTP server. |
name | string | Shows the name of the standard account. |
Property | Type | Description |
|---|---|---|
sendDailyReport | boolean | Shows if a daily report must be sent at the specified time. |
dailyTime | string | Shows when to send a daily report. |
EventEmailNotificationSettings Object
Property | Type | Description |
|---|---|---|
notifyOnSuccess | boolean | Shows if a notification must be sent on each Success session of a backup policy. |
notifyOnWarning | boolean | Shows if a notification must be sent on each Warning session of a backup policy. |
notifyOnFailure | boolean | Shows if a notification must be sent on each Failure session of a backup policy. |
Response Example
Request: GET https://abc.ukwest.cloudapp.azure.com/api/v1/settings/emailNotifications
Request Header: Authorization: Bearer <Access-Token>
Response: 200 OK
Response Body: { "smtpSettings": { "account": { "id": 1, "name": "Standard Account" }, "host": "gamma.tech.local", "port": 25, "useSecureConnection": true, "timeOutMiliSeconds": 100000 }, "notificationsEnabled": true, "from": "administrator@tech.local", "to": "group@.com", "subject": "[%JobResult%] %JobName% (%VmCount% virtual machines) %Issues%", "dailyReportSettings": { "sendDailyReport": true, "dailyTime": "00:00:00" }, "emailNotificationSettings": { "notifyOnSuccess": true, "notifyOnWarning": false, "notifyOnFailure": true } } |