Forked from ruanbekker/rocketchat_invoke_webhook_python.py
Created
August 26, 2020 19:44
-
-
Save rangelvarnier/58bc5e9838884ce76eb6b775b7633e9d 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