Created
August 2, 2017 23:06
-
-
Save ruanbekker/de26906b7815437de3d7840fb22964e0 to your computer and use it in GitHub Desktop.
Invoke Rocketchat Incoming Webhook with Python
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
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