This command will use Incoming Webhooks to send a message (which is a JSON payload) to Microsoft Team Team's channel.
| Option |
Description |
-u, --url <url> |
URL where to send the card to |
-t, --title [title] |
Title of the card |
-d, --description [description] |
Contents of the card |
-i, --imageUrl [imageUrl] |
URL of the image to include on the card |
-a, --actionUrl [actionUrl] |
URL that users should be sent to after clicking the View button on the card |
--card [card] |
Card definition |
--cardData [cardData] |
Card data. If your card specified in card is a card template, using cardData you can apply data to it. If you specify cardData, unknown options will be ignored. |
Remarks
The predefined card is automatically adjusted based on which options have been specified (title, description, imageUrl, actionUrl).
If your custom card is a card template, you can fill it with data either by specifying the complete data object using the cardData option, or by passing any number of arbitrary options that will be mapped onto the card. The arbitrary properties should not match any of the global options like output, query, debug etc. Data options like title, description, imageUrl and actionUrl will be mapped onto the card as well.
Examples
Send a predefined adaptive card with title and description
m365 adaptivecard send --url https://contoso.com/notify --title "Update" --description "Something has changed"
Send a predefined adaptive card with title, description and image
m365 adaptivecard send --url https://contoso.com/notify --title "Update" --description "Something has changed" --imageUrl https://contoso.com/assets/image.png
Send a predefined adaptive card with title, description and a button to view more information
m365 adaptivecard send --url https://contoso.com/notify --title "Update" --description "Something has changed" --actionUrl https://contoso.com/news/123
Send a custom adaptive card
m365 adaptivecard send --url https://contoso.com/notify --card card.json
Send a custom adaptive card and fill it with data
m365 adaptivecard send --url https://contoso.com/notify --card card.json --Account Contoso --OrderAmount 1500 --OrderDueBy 2020-12-22
Additional Information
Find out more about the incoming webhook connector here https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook
This command will use
Incoming Webhooksto send a message (which is a JSON payload) to Microsoft Team Team's channel.-u, --url <url>-t, --title [title]-d, --description [description]-i, --imageUrl [imageUrl]-a, --actionUrl [actionUrl]--card [card]--cardData [cardData]Remarks
The predefined card is automatically adjusted based on which options have been specified (title, description, imageUrl, actionUrl).
If your custom card is a card template, you can fill it with data either by specifying the complete data object using the
cardDataoption, or by passing any number of arbitrary options that will be mapped onto the card. The arbitrary properties should not match any of the global options likeoutput,query,debugetc. Data options like title, description, imageUrl and actionUrl will be mapped onto the card as well.Examples
Send a predefined adaptive card with title and description
m365 adaptivecard send --url https://contoso.com/notify --title "Update" --description "Something has changed"Send a predefined adaptive card with title, description and image
m365 adaptivecard send --url https://contoso.com/notify --title "Update" --description "Something has changed" --imageUrl https://contoso.com/assets/image.pngSend a predefined adaptive card with title, description and a button to view more information
m365 adaptivecard send --url https://contoso.com/notify --title "Update" --description "Something has changed" --actionUrl https://contoso.com/news/123Send a custom adaptive card
m365 adaptivecard send --url https://contoso.com/notify --card card.jsonSend a custom adaptive card and fill it with data
m365 adaptivecard send --url https://contoso.com/notify --card card.json --Account Contoso --OrderAmount 1500 --OrderDueBy 2020-12-22Additional Information
Find out more about the incoming webhook connector here https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook