https://docs.microsoft.com/pt-br/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using
#!/bin/bash
# bash script to send messages to Microsoft Teams.
TEAMS_CHANNEL=https://outlook.office.com/webhook/1b340db8-2c90-4b04-a227-36de3d1e6f91@0516330d-4308-4929-8f10-a239b3178a4f/IncomingWebhook/64048b36ce044210b911b334e64df8bf/41d0e9dd-0e33-410e-b128-5ef6bf0421a3
# curl -H 'Content-Type: application/json' -d '{
# "type": "message",
# "text": "'"$1"'"
# }' \
# $TEAMS_CHANNEL > /dev/null
curl -H 'Content-Type: application/json' -d '{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"themeColor": "0076D7",
"summary": "'"$USER_NAME"' needs a Code Review",
"sections": [{
"activityTitle": "'"$USER_NAME"' needs a Code Review",
"activitySubtitle": "On Project Tango",
"activityImage": "https://teamsnodesample.azurewebsites.net/static/img/image5.png",
"facts": [{
"name": "Assigned to",
"value": "Unassigned"
}, {
"name": "Due date",
"value": "Mon May 01 2017 17:07:18 GMT-0700 (Pacific Daylight Time)"
}, {
"name": "Status",
"value": "Not started"
}],
"markdown": true
}],
"potentialAction": [{
"@type": "ActionCard",
"name": "Add a comment",
"inputs": [{
"@type": "TextInput",
"id": "comment",
"isMultiline": false,
"title": "Add a comment here for this task"
}],
"actions": [{
"@type": "HttpPOST",
"name": "Add comment",
"target": "http://..."
}]
}, {
"@type": "ActionCard",
"name": "Set due date",
"inputs": [{
"@type": "DateInput",
"id": "dueDate",
"title": "Enter a due date for this task"
}],
"actions": [{
"@type": "HttpPOST",
"name": "Save",
"target": "http://..."
}]
}, {
"@type": "ActionCard",
"name": "Change status",
"inputs": [{
"@type": "MultichoiceInput",
"id": "list",
"title": "Select a status",
"isMultiSelect": "false",
"choices": [{
"display": "In Progress",
"value": "1"
}, {
"display": "Active",
"value": "2"
}, {
"display": "Closed",
"value": "3"
}]
}],
"actions": [{
"@type": "HttpPOST",
"name": "Save",
"target": "http://..."
}]
}]
}' \
$TEAMS_CHANNEL > /dev/null
# curl -H 'Content-Type: application/json' -d '
# "body": {
# "contentType": "html",
# "content": "Hello World"
# }' \
# $TEAMS_CHANNEL > /dev/null
#curl -H 'Content-Type: application/json' GET https://graph.microsoft.com/v1.0/me/messages?filter=emailAddress eq 'mpaz-redstage'