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

Get all notification 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
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}
Get details of a notification profile with a specific label
Request URL
https://<BMC Helix Portal URL>/ans/api/v1/profiles/{label}
Request header
Content-Type: application/json
Authorization: Bearer <JWT_token>
Parameters
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}
Update a notification profile
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

 

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}
Revert a notification profile to its default settings
Request URL
https://<BMC Helix Portal URL>/ans/api/v1/profiles/{label}
Request header
Content-Type: application/json
Authorization: Bearer <JWT_token>
Parameters
Successful response
{
 "message": "SUCCESS"
}

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC Helix Portal 26.1