This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see
Cake.MicrosoftTeams.
Summary
Posts a message to a Microsoft Teams channel
Syntax
public static HttpStatusCode MicrosoftTeamsPostMessage(this ICakeContext context, string message, MicrosoftTeamsSettings settings)
Examples
MicrosoftTeamsPostMessage("Hello from Cake!",
new MicrosoftTeamsSettings {
IncomingWebhookUrl = EnvironmentVariable("MicrosoftTeamsWebHook")
});
Attributes
| Type |
Description |
| CakeMethodAliasAttribute |
|
| CakeAliasCategoryAttribute |
|
Parameters
| Name |
Type |
Description |
| context |
ICakeContext |
The context. |
| message |
string |
The message. |
| settings |
MicrosoftTeamsSettings |
The settings. |
Return Value
| Type |
Description |
| HttpStatusCode |
Response Code
Description
Details
| 200 | Ok | A well-formed request is sent to an existing webhook. The request contains a valid payload, and has a valid corresponding webhook configuration. |
| 400 | Bad Request | 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.. |
| 404 | Not Found | A request is sent to a webhook that does not exist. |
| 413 | Payload Too Large | A request is sent to a webhook that is too large in size for processing. |
| 429 | Too Many Requests | Client is sending too many requests and Office 365 is throttling the requests to a webhook. |
|