跳至主内容

获取通知设置

该方法返回通知设置。

参数

参数

类型

可选

描述

账户ID

字符串

需获取通知设置的账户ID。若未提供,则返回API密钥生成账户的通知设置。

返回值

该方法返回包含当前通知设置的对象:

  • 自动删除期限 - 生成的通知将在指定天数后自动删除

  • 包含设备名称 - 布尔值,表示电子邮件通知中是否包含设备名称

  • includeDeviceFQDN - 布尔值,指示是否在通过电子邮件发送的通知中包含设备FQDN

  • emailAddresses - 发送通知时使用的附加电子邮件地址列表

  • notificationsSettings - 包含所有可用通知设置的列表。列表中每个条目包含以下字段:

    • type ,通知类型,

    • enabled , True 表示启用该通知, False 表示禁用,

    • visibilitySettings ,包含已配置可见性设置的对象。更多信息请参阅 通知可见性选项 .

    • configurationSettings ,特定于通知的配置。更多信息请参阅 通知类型与configurationSettings的对应关系 .

    • sendOnlyPlainTextEmail ,指定通知邮件是否仅以纯文本形式发送。可选值: True 表示发送纯文本邮件,或 False 表示使用HTML格式。

示例

请求

{
       "params": {
           "accountId": "55896b87b7894d0f367b23c8"
       },
       "jsonrpc": "2.0",
       "method": "getNotificationsSettings",
       "id": "5399c9b5-0b46-45e4-81aa-889952433d86"
  }

响应

{
    "params": {
		"accountId": "55896b87b7894d0f367b23c8",
		"deleteAfter": 17,
		"includeDeviceName": true,
		"includeDeviceFQDN": true,
		"emailAddresses": ["example1@example.com"],
		"notificationsSettings":[
			{
				"type" : 1,
				"enabled" : true,
				"visibilitySettings" : {
					"sendPerEmail" : true,
					"showInConsole" : true,
					"useCustomEmailDistribution": false
					"emails" : ["example2@example.com"],
					"logToServer" : true
					"logToServer" : true,
					"setCustomEmailSubject": true,
					"emailSubject": "恶意软件爆发自定义主题"
				},
				"configurationSettings" : {
					"threshold" : 15,
					"useThreshold" : true
				}
			}
		],
		"sendOnlyPlainTextEmail": true
	},
	"jsonrpc": "2.0",
	"method": "configureNotificationsSettings",
	"id": "5399c9b5-0b46-45e4-81aa-889952433d68"
}