Alerts API - POST an alert recipient

Applies to NAM 2019+

Adds an alert recipient.

POST
  • url https://{console-host}:{console-port}/cxf/api/v1/config/alerts/recipients

Response format

The AlertPublicRestErrorResponse object

Element Type Description
errorCode string
errorMessage string

The ScriptRecipient object

Element Type Description
id integer
enabled boolean
description string
executable string
parameters string
recipientType string
  • USER = email recipient
  • TRAP = SNMP trap recipient
  • MOBILE = Slack recipient
  • SCRIPT = Script recipient

The TrapRecipient object

Element Type Description
id integer
enabled boolean
host string
port integer
readCommunityName string
recipientType string
  • USER = email recipient
  • TRAP = SNMP trap recipient
  • MOBILE = Slack recipient
  • SCRIPT = Script recipient

Response codes

Code Description
200

Added recipient along with ID assigned by NAM Console.

400

The request was invalid.

Example

To POST a new trap recipient on 1.2.3.4:80, use the POST https://172.18.147.215:4183/cxf/api/v1/config/alerts/recipients/ request with an application/json payload specifying host 1.2.3.4, port 80, and recipientType TRAP, and enabled true.

{
  "enabled": true,
  "host": "1.2.3.4",
  "port": 80,
  "readCommunityName": "my-community-name",
  "recipientType": "TRAP"
}

If the request is successful, you will get a 200 response code and the new trap recipient will appear in the NAM Console, so you can add that recipient to your NAM alerts.

NAM API alert recipient