Skip to content

Commit

Permalink
Add Microsoft Teams webhook support for notifications (#4971)
Browse files Browse the repository at this point in the history
* Add Microsoft Teams webhook support for notifications

Signed-off-by: Fanit Kolchina <[email protected]>

* Update _observing-your-data/notifications/index.md

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>

* Implemented editorial comments

Signed-off-by: Fanit Kolchina <[email protected]>

* Sample to example

Signed-off-by: Fanit Kolchina <[email protected]>

---------

Signed-off-by: Fanit Kolchina <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>
Co-authored-by: Nathan Bower <[email protected]>
  • Loading branch information
kolchfa-aws and natebower authored Sep 22, 2023
1 parent 3a23cc6 commit 22596ad
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
46 changes: 23 additions & 23 deletions _observing-your-data/notifications/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ If you want to programmatically define your notification channels and sources fo

To retrieve a list of all supported notification configuration types, send a GET request to the `features` resource.

#### Sample Request
#### Example request

```json
GET /_plugins/_notifications/features
```

#### Sample Response
#### Example response

```json
{
Expand All @@ -53,13 +53,13 @@ GET /_plugins/_notifications/features

To retrieve a list of all notification configurations, send a GET request to the `configs` resource.

#### Sample Request
#### Example request

```json
GET _plugins/_notifications/configs
```

#### Sample Response
#### Example response

```json
{
Expand Down Expand Up @@ -113,16 +113,16 @@ last_updated_time_ms | The Unix time in milliseconds of when the channel was las
created_time_ms | The Unix time in milliseconds of when the channel was created.
is_enabled | Indicates whether the channel is enabled.
config_type | The channel type. Valid options are `sns`, `slack`, `chime`, `webhook`, `smtp_account`, `ses_account`, `email_group`, and `email`.
name | The channel's name.
description | The channel's description.
name | The channel name.
description | The channel description.
email.email_account_id | The sender email addresses the channel uses.
email.email_group_id_list | The email groups the channel uses.
email.recipient_list | The channel's recipient list.
email_group.recipient_list | The channel's list of email recipient groups.
email.recipient_list | The channel recipient list.
email_group.recipient_list | The channel list of email recipient groups.
smtp_account.method | The email encryption method.
slack.url | The Slack channel's URL.
chime.url | The Amazon Chime connection's URL.
webhook.url | The webhook's URL.
slack.url | The Slack channel URL.
chime.url | The Amazon Chime connection URL.
webhook.url | The webhook URL.
smtp_account.host | The domain of the SMTP account.
smtp_account.from_address | The email account's sender address.
smtp_account.method | The SMTP account's encryption method.
Expand All @@ -136,7 +136,7 @@ ses_account.from_address | The Amazon SES account's sender email address.

To create a notification channel configuration, send a POST request to the `configs` resource.

#### Sample Request
#### Example request

```json
POST /_plugins/_notifications/configs/
Expand Down Expand Up @@ -236,7 +236,7 @@ POST /_plugins/_notifications/configs/
}
```

#### Sample Response
#### Example response

```json
{
Expand All @@ -249,13 +249,13 @@ POST /_plugins/_notifications/configs/

To get a channel configuration by `config_id`, send a GET request and specify the `config_id` as a path parameter.

#### Sample Request
#### Example request

```json
GET _plugins/_notifications/configs/<config_id>
```

#### Sample Response
#### Example response

```json
{
Expand Down Expand Up @@ -286,7 +286,7 @@ GET _plugins/_notifications/configs/<config_id>

To update a channel configuration, send a POST request to the `configs` resource and specify the channel's `config_id` as a path parameter. Specify the new configuration details in the request body.

#### Sample Request
#### Example request

```json
PUT _plugins/_notifications/configs/<config_id>
Expand All @@ -303,7 +303,7 @@ PUT _plugins/_notifications/configs/<config_id>
}
```

#### Sample Response
#### Example response

```json
{
Expand All @@ -316,13 +316,13 @@ PUT _plugins/_notifications/configs/<config_id>

To delete a channel configuration, send a DELETE request to the `configs` resource and specify the `config_id` as a path parameter.

#### Sample Request
#### Example request

```json
DELETE /_plugins/_notifications/configs/<config_id>
```

#### Sample Response
#### Example response

```json
{
Expand All @@ -334,13 +334,13 @@ DELETE /_plugins/_notifications/configs/<config_id>

You can also submit a comma-separated list of channel IDs you want to delete, and OpenSearch deletes all of the specified notification channels.

#### Sample Request
#### Example request

```json
DELETE /_plugins/_notifications/configs/?config_id_list=<config_id1>,<config_id2>,<config_id3>...
```

#### Sample Response
#### Example response

```json
{
Expand All @@ -357,13 +357,13 @@ DELETE /_plugins/_notifications/configs/?config_id_list=<config_id1>,<config_id2

To send a test notification, send a GET request to `/feature/test/` and specify the channel configuration's `config_id` as a path parameter.

#### Sample Request
#### Example request

```json
GET _plugins/_notifications/feature/test/<config_id>
```

#### Sample Response
#### Example response

```json
{
Expand Down
4 changes: 2 additions & 2 deletions _observing-your-data/notifications/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The Notifications plugin provides a central location for all of your notificatio

You can use either OpenSearch Dashboards or the REST API to configure notifications. Dashboards offers a more organized way of selecting a channel type and selecting which OpenSearch plugin sources you want to use, whereas the REST API lets you programmatically define your notification channels for better versioning and reuse later on.

1. Use the Dashboards UI to first create a channel that receives notifications from other plugins. Supported communication channels include Amazon Chime, Amazon Simple Notification Service (Amazon SNS), Amazon Simple Email Service (Amazon SES), email through SMTP, Slack, and custom webhooks. After you’ve configured your channel and plugin sources, send messages and start tracking your notifications from the Notifications plugin's dashboard.
1. Use the Dashboards UI to first create a channel that receives notifications from other plugins. Supported communication channels include Amazon Chime, Amazon Simple Notification Service (Amazon SNS), Amazon Simple Email Service (Amazon SES), email through SMTP, Slack, Microsoft Teams, and custom webhooks. After you’ve configured your channel and plugin sources, send messages and start tracking your notifications from the Notifications plugin's dashboard.

2. Use the Notifications REST API to configure all of your channel's settings. To use the API, you must have your notification's name, description, channel type, which OpenSearch plugins to use as sources, and other associated URLs or groups.

Expand All @@ -23,7 +23,7 @@ You can use either OpenSearch Dashboards or the REST API to configure notificati
In OpenSearch Dashboards, choose **Notifications**, **Channels**, and **Create channel**.

1. In the **Name and description** section, specify a name and optional description for your channel.
2. In the **Configurations** section, select the channel type and enter the necessary information for each type. For more information about configuring a channel that uses Amazon SNS or email, refer to the sections below. If you want to use Amazon Chime or Slack, you need to specify the webhook URL. For more information about using webhooks, see the documentation for [Slack](https://api.slack.com/messaging/webhooks) and [Amazon Chime](https://docs.aws.amazon.com/chime/latest/ug/webhooks.html).
2. In the **Configurations** section, select the channel type and enter the necessary information for each type. For more information about configuring a channel that uses Amazon SNS or email, refer to the sections below. If you want to use Amazon Chime or Slack, you need to specify the webhook URL. For more information about using webhooks, see the documentation for [Slack](https://api.slack.com/messaging/webhooks), [Microsoft Teams](https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/what-are-webhooks-and-connectors), or [Amazon Chime](https://docs.aws.amazon.com/chime/latest/ug/webhooks.html).

If you want to use custom webhooks, you must specify more information: parameters and headers. For example, if your endpoint requires basic authentication, you might need to add a header with an authorization key and a value of `Basic <Base64-encoded-credential-string>`. You might also need to change `Content-Type` to whatever your webhook requires. Popular values are `application/json`, `application/xml`, and `text/plain`.

Expand Down

0 comments on commit 22596ad

Please sign in to comment.