Alerts API - GET an alert recipient

Applies to NAM 2019+

Returns the recipient specified by ID.

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

Parameters

Parameter Type Description In Required
id

Recipient ID.

path required

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

Recipient with given name.

400

The request was invalid.

404

The recipient was not found.

409

More than one recipient with the specified ID was found.

Example

In this example response, we used

GET https://console-address-and-port/cxf/api/v1/config/alerts/recipients/

to get a list of recipients. Two recipients were returned.


[
    {
        "user": {
            "login": "test-user-01",
            "firstName": "test-user-01's first name",
            "lastName": "test-user-01's last name",
            "email": "test-user-01@dynatrace.com"
        },
        "username": "test-user-01",
        "recipientType": "USER",
        "id": 15,
        "enabled": true
    },
    {
        "user": {
            "login": "test-user-02",
            "firstName": "test-user-02's first name",
            "lastName": "test-user-02's last name",
            "email": "test-user-02@dynatrace.com"
        },
        "username": "test-user-02",
        "recipientType": "USER",
        "id": 17,
        "enabled": true
    },
]

To get the details on just one recipient, use the id value. We can see from response above that test-user-01 has an id of 15, so now we issue a GET request for just that recipient:

GET https://console-address-and-port/cxf/api/v1/config/alerts/recipients/15

The request returned:

{
    "user": {
        "login": "test-user-01",
        "firstName": "test-user-01's first name",
        "lastName": "test-user-01's last name",
        "email": "test-user-01@dynatrace.com"
    },
    "username": "test-user-01",
    "recipientType": "USER",
    "id": 15,
    "enabled": true
}