https://github.com/cake-contrib/cake.microsoftteams
Cake Addin that provides Microsoft Teams aliases
https://github.com/cake-contrib/cake.microsoftteams
cake-addin cake-build
Last synced: 4 months ago
JSON representation
Cake Addin that provides Microsoft Teams aliases
- Host: GitHub
- URL: https://github.com/cake-contrib/cake.microsoftteams
- Owner: cake-contrib
- License: mit
- Created: 2016-11-03T00:50:21.000Z (over 8 years ago)
- Default Branch: develop
- Last Pushed: 2024-08-05T22:32:40.000Z (9 months ago)
- Last Synced: 2024-12-12T23:16:02.400Z (5 months ago)
- Topics: cake-addin, cake-build
- Language: C#
- Homepage: https://cakebuild.net/extensions/cake-microsoftteams
- Size: 85.9 KB
- Stars: 7
- Watchers: 6
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cake Microsoft Teams
Cake addin that provides Microsoft Teams aliases
## Usage
### Simple message
```cake
#addin nuget:?package=Cake.MicrosoftTeamsSystem.Net.HttpStatusCode result = MicrosoftTeamsPostMessage("Hello from Cake!",
new MicrosoftTeamsSettings {
IncomingWebhookUrl = EnvironmentVariable("MicrosoftTeamsWebHook")
});
```
### Advanced message
```cake
#addin nuget:?package=Cake.MicrosoftTeamsvar messageCard = new MicrosoftTeamsMessageCard {
summary = "Cake posted message using Cake.MicrosoftTeams",
title ="Cake Microsoft Teams",
sections = new []{
new MicrosoftTeamsMessageSection{
activityTitle = "Cake posted message",
activitySubtitle = "using Cake.MicrosoftTeams",
activityText = "Here is the runtime Information",
activityImage = "https://raw.githubusercontent.com/cake-build/graphics/master/png/cake-small.png",
facts = new [] {
new MicrosoftTeamsMessageFacts { name ="CakeVersion", value = Context.Environment.Runtime.CakeVersion.ToString() },
new MicrosoftTeamsMessageFacts { name ="TargetFramework", value = Context.Environment.Runtime.TargetFramework.ToString() },
new MicrosoftTeamsMessageFacts { name ="IsCoreClr", value = Context.Environment.Runtime.IsCoreClr.ToString() }
},
}
},
potentialAction = new [] {
new MicrosoftTeamsMessagePotentialAction {
name = "View in Trello",
target = new []{"https://trello.com/c/1101/"}
}
}
};System.Net.HttpStatusCode result = MicrosoftTeamsPostMessage(messageCard,
new MicrosoftTeamsSettings {
IncomingWebhookUrl = EnvironmentVariable("MicrosoftTeamsWebHook")
});```
### Return values
|Response Code | Details |
|-----------------------------|------------|
|OK (200) | A well-formed request is sent to an existing webhook. The request contains a valid payload, and has a valid corresponding webhook configuration.|
|BadRequest (400) | An incorrectly-formed request is sent to a webhook that exists. The payload could contain non-parseable JSON, incorrect JSON values (e.g. expected a String, got an array), incorrect content-type, etc..|
|NotFound (404) | A request is sent to a webhook that does not exist.|
|RequestEntityTooLarge (413) | A request is sent to a webhook that is too large in size for processing.|
|429 (429) |Client is sending too many requests and Office 365 is throttling the requests to a webhook.|## Discussion
For questions and to discuss ideas & feature requests, use the [GitHub discussions on the Cake GitHub repository](https://github.com/cake-build/cake/discussions), under the [Extension Q&A](https://github.com/cake-build/cake/discussions/categories/extension-q-a) category.
[](https://github.com/cake-build/cake/discussions)