Creating Notification Channels
You can create notification channels using the following API.
Request URL
POST https://http-collector-observability.sixthsense.rakuten.com/api-externalization/api/v1/channels
Header
Header key - Authorization
Header value - Bearer {{access_token}} (Navigate to Settings > Access token > Show access token in the SixthSence portal.)
Request
{
"channelName": "string",
"template": "string",
"type": "EMAIL",
"values": [
"string"
]
}
Example:
{
"channelName": "test",
"type": "WEBHOOK",
"values": [
"https://webhook.site/a0aac6c4-fb99-4dc8-b415-e31a393faa14"
],
"template": "{\"ALERT_NAME\":\"{{alert_name}}\",\"CAPABILITY\":\"{{capability}}\",\"SEVERITY\":\"{{severity}}\",\"ENTITY_NAME\":\"{{service_name}}\",\"DESC\":\"
{{event_type}}\",\"COMP\":\"{{metric_name}}\",\"NOTES\":\"{{tool_name}} has detected a problem with {{service_name}} application where {{metric_name}} was
{{aggregator_operator}} {{threshold_value}} and the current value is around {{current_value}} for the last {{period}} min(s).\",\"TIME\":\"
{{timestamp}}\",\"TOOL_NAME\":\"{{tool_name}}\",\"URL\":\"{{url}}\"}"
}
Parameters | Description |
---|---|
channelName | Channel Name of length 100 |
type | EMAIL, SLACK, WEBHOOK |
values | Lists emails, slack url, webhook url based on type. |
template | Accepts only a valid JSON template customised for the WEBHOOK notification. |
Response
{
"data": {},
"message": "string",
"success": true
}
Example
{
"message": "Notification channel successfully created.",
"success": true,
"data": {
"channelId": "4KuExIUBVVmCg9TvYqE3",
"channelName": "test",
"type": "WEBHOOK",
"values": [
"https://webhook.site/a0aac6c4-fb99-4dc8-b415-e31a393faa14"
],
"template": "{\"ALERT_NAME\":\"{{alert_name}}\",\"CAPABILITY\":\"{{capability}}\",\"SEVERITY\":\"{{severity}}\",\"ENTITY_NAME\":\"{{service_name}}\",\"DESC\":\"{{event_type}}\",\"COMP\":\"{{metric_name}}\",\"NOTES\": \"{{tool_name}} has detected a problem with {{service_name}} application where {{metric_name}} was {{aggregator_operator}} {{threshold_value}} and the current value is around {{current_value}} for the last {{period}} min(s).\",\"TIME\":\"{{timestamp}}\",\"TOOL_NAME\":\"{{tool_name}}\",\"URL\":\"{{url}}\"}" ,
"lastUpdatedAt": 1674216304426,
"lastUpdatedBy": "API user",
"createdAt": 1674216304426,
"createdBy": "API user"
}
}