Method TrySendChannelNotificationAsync
- Namespace
- Skyline.DataMiner.DcpChatIntegrationHelper.Teams
- Assembly
- Skyline.DataMiner.DcpChatIntegrationHelper.dll
TrySendChannelNotificationAsync(string, string, string, CancellationToken)
Tries to send a notification/message in the given channel in Microsoft Teams.
Task TrySendChannelNotificationAsync(string teamId, string channelId, string notification, CancellationToken cancellationToken = default)
Parameters
teamId
stringThe id of the team where to create the channel. This id is returned when creating a team using TryCreateTeamAsync(string, string, CancellationToken) or when fetching them using TryGetTeamsAsync(CancellationToken).
channelId
stringThe id of the channel where to send the notification/message. This id is returned when creating a channel using TryCreateChannelAsync(string, string, string, CancellationToken) or when fetching them using TryGetChannelsAsync(string, CancellationToken).
notification
stringThe notification/message to send in the channel.
cancellationToken
CancellationToken
Returns
Remarks
The organizations Microsoft Teams tenant must be configured in the Admin App and the required permissions must be granted. Note that, if new features require more permissions than were granted before, you can easily refresh your configured tenant to update it's permissions in the Admin App.
Exceptions
- TeamsChatIntegrationException
If anything went wrong.
TrySendChannelNotificationAsync(string, string, IEnumerable<AdaptiveElement>, string, CancellationToken)
Tries to send a notification/message using AdaptiveCards.AdaptiveElements (see AdaptiveCards.AdaptiveCard) in the given channel in Microsoft Teams.
Task TrySendChannelNotificationAsync(string teamId, string channelId, IEnumerable<AdaptiveElement> notification, string summary = null, CancellationToken cancellationToken = default)
Parameters
teamId
stringThe id of the team where to create the channel. This id is returned when creating a team using TryCreateTeamAsync(string, string, CancellationToken) or when fetching them using TryGetTeamsAsync(CancellationToken).
channelId
stringThe id of the channel where to send the notification/message. This id is returned when creating a channel using TryCreateChannelAsync(string, string, string, CancellationToken) or when fetching them using TryGetChannelsAsync(string, CancellationToken).
notification
IEnumerable<AdaptiveElement>The notification/message using AdaptiveCards.AdaptiveElements (see AdaptiveCards.AdaptiveCard) to send in the channel. Read more on Adaptive Cards > Schema Explorer > body.
summary
stringThe summary about this notification. A short text that will be used as the description of the notification and immersive readers. Optional, no default value.
cancellationToken
CancellationToken
Returns
Remarks
The organizations Microsoft Teams tenant must be configured in the Admin App and the required permissions must be granted. Note that, if new features require more permissions than were granted before, you can easily refresh your configured tenant to update it's permissions in the Admin App.
Exceptions
- TeamsChatIntegrationException
If anything went wrong.