Create Email Channel issue
search cancel

Create Email Channel issue

book

Article ID: 376110

calendar_today

Updated On:

Products

DX OI SaaS

Issue/Introduction

I am trying to create an email channel following the documentation

I am executing this curl

curl -X PUT "https://axa.dxi-na1.saas.broadcom.com/ess/notify/v1/channels" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
  "id": 500,
  "orgId": "<tenant>",
  "keyLevel": 1,
  "name": "TestChannelAPI",
  "protocol": "SMTP",
  "subProtocol": "SMTP",
  "status": false,
  "author": "<name>",
  "filterNames": [],
  "smtpItsmConfigs": {
    "templateName": "",
    "templateLocale": "en_US",
    "addresses": [
      "<email address>"
    ]
  },
  "maskRecipients": false
}'

 

with the correct TOKEN and I am seeing this error message

{
  "code" : 3011599,
  "msg" : "Internal Error: Cannot invoke &quot;java.util.List.iterator()&quot; because the return value of &quot;com.ca.emm.notify.api.model.SmtpItsmConfigsDAO.getTemplates()&quot; is null",
  "desc" : "Internal Error: Cannot invoke &quot;java.util.List.iterator()&quot; because the return value of &quot;com.ca.emm.notify.api.model.SmtpItsmConfigsDAO.getTemplates()&quot; is null"

}

Resolution

Use this URL

curl -X PUT "https://axa.dxi-na1.saas.broadcom.com/notify/notify/v1/channels" \

 

For creating a channel you can use below payload, id should be 0

{
    "id": 0,
    "orgId": "TENANT1",
    "keyLevel": 1,
    "name": "Test-1",
    "protocol": "SMTP",
    "subProtocol": "SMTP",
    "status": false,
    "filterNames": [],
    "smtpItsmConfigs": {
        "templates": [
            {
                "templateName": "NotifyAlarmTemplate",
                "templateLocale": "en_US",
                "templateContentVersion": 0,
                "alarmCategory": "rawAlarm"
            },
            {
                "templateName": "ServiceAlarmNotificationTemplate",
                "templateLocale": "en_US",
                "templateContentVersion": 0,
                "alarmCategory": "service"
            },
            {
                "templateName": "SituationsAlarmNotificationTemplate",
                "templateLocale": "en_US",
                "templateContentVersion": 0,
                "alarmCategory": "situation"
            }
        ],
        "addresses": [
            "<email address>"
        ]
    },
    "maskRecipients": false
}

 

For updating a channel you will need to pass correct id, payload is same

{
    "id": 59,
    "orgId": "TENANT1",
    "keyLevel": 1,
    "name": "Test-1",
    "protocol": "SMTP",
    "subProtocol": "SMTP",
    "status": true,
    "filterNames": [],
    "smtpItsmConfigs": {
        "templates": [
            {
                "templateName": "NotifyAlarmTemplate",
                "templateLocale": "en_US",
                "templateContentVersion": 0,
                "alarmCategory": "rawAlarm"
            },
            {
                "templateName": "ServiceAlarmNotificationTemplate",
                "templateLocale": "en_US",
                "templateContentVersion": 0,
                "alarmCategory": "service"
            },
            {
                "templateName": "SituationsAlarmNotificationTemplate",
                "templateLocale": "en_US",
                "templateContentVersion": 0,
                "alarmCategory": "situation"
            }
        ],
        "addresses": [
            "<email address>"
        ]
    },
    "maskRecipients": false
}