Skip to content

Instantly share code, notes, and snippets.

@ruanbekker
Created August 2, 2017 23:06
Show Gist options
  • Save ruanbekker/de26906b7815437de3d7840fb22964e0 to your computer and use it in GitHub Desktop.
Save ruanbekker/de26906b7815437de3d7840fb22964e0 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