Notification profile endpoints in the REST API

The following section provides a list of supported endpoints for notification profiles and details about running these endpoints.

Before you run an endpoint, you must authenticate yourself. For more information, see Access and authentication for the REST API.


Notification profiles

You can perform the following operations related to notification profiles: 

GET  /ans/api/v1/profiles

Request URL
https://<BMC Helix Portal URL>/ans/api/v1/profiles
Request URL for optional parameters
https://<BMC Helix Portal URL>/ans/api/v1/profiles?page=0&size=10
Request header
Content-Type: application/json
Authorization: Bearer <JWT_token>
Parameters

NameLocated inDescriptionMandatoryScheme
pagequery

Page number from which you want to retrieve notification profiles. 

Note that the page number starts from 0 (default). Use this parameter in conjunction with the size parameter.

nonumber
sizequery

Total number of records that you want to retrieve from a page.

Default: 1000 records

nonumber

Successful response
{
   "records":[
      {
         "label":"string",
         "severity":"INFO",
         "enabled":true,
         "modified_date_time":"string",
         "category":"string",
         "display_name":"string",
         "description":"string",
         "recipients":{
            "GROUP_IDS":[
               "string"
            ],
            "USER_IDS":[
               "string"
            ],
            "USERS":[
               "string"
            ],
            "GROUPS":[
               "string"
            ],
            "KEYWORDS":[
               "string"
            ]
         }
      }
   ],
   "_metadata":{
      "page":0,
      "records_per_page":0,
      "page_count":0,
      "total_count":0,
      "total_unread_count":0,
      "total_unread_banner_count":0
   }
}
GET /ans/api/v1/profiles/{label}
Request URL
https://<BMC Helix Portal URL>/ans/api/v1/profiles/{label}
Request header
Content-Type: application/json
Authorization: Bearer <JWT_token>
Parameters

NameLocated inDescriptionMandatoryScheme
labelpath

Notification profile label name 

yesstring

Successful response
{
   "label":"string",
   "severity":"INFO",
   "enabled":true,
   "modified_date_time":"string",
   "category":"string",
   "display_name":"string",
   "description":"string",
   "recipients":{
      "GROUP_IDS":[
         "string"
      ],
      "USER_IDS":[
         "string"
      ],
      "USERS":[
         "string"
      ],
      "GROUPS":[
         "string"
      ],
      "KEYWORDS":[
         "string"
      ]
   }
}
PATCH /ans/api/v1/profiles/{label}
Request URL
https://<BMC Helix Portal URL>/ans/api/v1/profiles/{label}
Request header
Content-Type: application/json
Authorization: Bearer <JWT_token>
Request body
{
   "severity":"INFO",
   "recipients":{
      "additionalProp":[
         "string"
      ]
   },
   "description":"string",
   "enabled":true,
   "category":"string",
   "display_name":"string",
   "channels":{
      "inapp":{
         "header":"string",
         "message":"string",
         "expiry":"string",
         "banner":false
      }
   }
}
Example request body
{
   "severity":"INFO",
   "category":"ANS",
   "display_name":"Display global recipients",
   "description":"description",
   "recipients":{
      "group_ids":[
         "group1"
      ]
   },
   "channels":{
      "inapp":{
         "header":"New User got added",
         "message":"New user \"$params.user_name\" added & associated with group \"$params.group_name\"",
         "expiry":"3"
      }
   }
}
Parameters


NameLocated inDescriptionMandatorySchema
labelpathLabel of the notification profile you want to updateyesstring
severitybody

Updated severity for the notification profile

Valid values:

  • INFO
  • WARN
  • CRITICAL
nostring
categorybodyUpdated category of the notification profilenostring
display_namebodyUpdated display name of the notification profilenostring
descriptionbodyUpdated description the notification profilenostring
recipientsbody

List of recipients to send notification to which notification should be sent

Valid values:

  • "groups":[group names]
  • "group_ids":[group ids]
  • "users":[user/principal names]
  • "user_ids":[user ids]
  • "keywords" : ["ALL_USERS]
nostring

Successful response
{
  "label": "string"
}
Unsuccessful response

Scenario: When a label contains spaces or special characters such as $ and @

{
    "timestamp": "2022-01-19T06:58:38.949405100Z",
    "transactionId": "d032f6eb-3cbd-49fc-8f6b-85bb13a5efd5",
    "code": 400,
    "message": "createNotificationProfile.profileLabel: Label can only contain these characters [A-Za-z0-9_-], createNotificationProfile.profileLabel: label is mandatory."
}
DELETE /ans/api/v1/profiles/{label}
Request URL
https://<BMC Helix Portal URL>/ans/api/v1/profiles/{label}
Request header
Content-Type: application/json
Authorization: Bearer <JWT_token>
Parameters

NameLocated inDescriptionMandatoryScheme

label

pathLabel for the notification profile for which you want to revert the settingsyesstring

Successful response
{
  "message": "SUCCESS"
}
Was this page helpful? Yes No Submitting... Thank you

Comments