Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rangelvarnier/58bc5e9838884ce76eb6b775b7633e9d to your computer and use it in GitHub Desktop.
Save rangelvarnier/58bc5e9838884ce76eb6b775b7633e9d to your computer and use it in GitHub Desktop.
Invoke Rocketchat Incoming Webhook with Python
import requests
import json
uri = 'https://domain.com/hooks/1234AbcD'
data={}
data = {
"username": "Python Bot",
"icon_emoji": ":whale:",
"attachments": [
{
"title": "Docker Release Notes",
"title_link": "https://docs.docker.com/release-notes/docker-ce/",
"text": "Docer CE Release Notes Information",
"image_url": "https://storage.googleapis.com/static.ianlewis.org/prod/img/docker/large_v-trans.png",
"color":"#764FA5"
}
]
}
r = requests.post(uri, json.dumps(data)).content
print(r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment