Created
June 1, 2019 11:40
-
-
Save dwdraju/b7f1233694beb54d18c09069a3a21040 to your computer and use it in GitHub Desktop.
Google Hangout Chat Webhook
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
from httplib2 import Http | |
from json import dumps | |
# | |
# Hangouts Chat incoming webhook quickstart | |
# | |
def main(): | |
url = 'URL' | |
bot_message = { | |
'text' : 'Hello there!'} | |
message_headers = { 'Content-Type': 'application/json; charset=UTF-8'} | |
http_obj = Http() | |
response = http_obj.request( | |
uri=url, | |
method='POST', | |
headers=message_headers, | |
body=dumps(bot_message), | |
) | |
print(response) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment