Skip to content

Instantly share code, notes, and snippets.

@dwdraju
Created June 1, 2019 11:40
Show Gist options
  • Save dwdraju/b7f1233694beb54d18c09069a3a21040 to your computer and use it in GitHub Desktop.
Save dwdraju/b7f1233694beb54d18c09069a3a21040 to your computer and use it in GitHub Desktop.
Google Hangout Chat Webhook
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