Created
October 6, 2021 22:30
-
-
Save timb-machine/efc47569be069583742cccfdef4dffd2 to your computer and use it in GitHub Desktop.
Webex Teams as a callback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# setup webex bot auth token env var - get auth here: https://developer.webex.com/my-apps/new/bot | |
export WEBEX_TOKEN="GET_TOKEN_ABOVE" | |
# get room id | |
WEBEX_ROOMID=$(curl --request GET --header "Authorization: Bearer $WEBEX_TOKEN" https://webexapis.com/v1/rooms |jq -r '.items[] | select(.title == "Room Name") | .id') | |
# post message | |
WEBEX_MSG="notification here" | |
curl --request POST --header "Authorization: Bearer $WEBEX_TOKEN" --form "roomId=$WEBEX_ROOMID" --form "text=$WEBEX_MSG" https://webexapis.com/v1/messages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment