Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ratacibernetica/5655a87e9efd137cf832d51778d3911f to your computer and use it in GitHub Desktop.
Save ratacibernetica/5655a87e9efd137cf832d51778d3911f to your computer and use it in GitHub Desktop.
send message to Teams via incoming webhook in bash
#!/bin/bash
# source https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using#post-a-message-to-the-webhook-using-curl
URL="https://yourllc.webhook.office.com/webhookb2/uuid@tenant/IncomingWebhook/uuid"
MSG="$@"
# on macOS or Linux
curl -H 'Content-Type: application/json' -d "{\"text\": \"$MSG\"}" $URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment