1
0

Feed chat webhook prototype

This commit is contained in:
Jon Michael Aanes 2024-12-19 13:58:39 +01:00
commit a260c318af

View File

@ -0,0 +1,21 @@
from json import dumps
import requests
import secrets_loader
secrets = secrets_loader.SecretsLoader()
WEBHOOK_URL = secrets.load_or_fail('WEBHOOK_URL')
def main():
"""Google Chat incoming webhook quickstart."""
app_message = {"text": "Hello from a Python script!"}
message_headers = {"Content-Type": "application/json; charset=UTF-8"}
response = requests.post(
WEBHOOK_URL,
headers=message_headers,
json=app_message,
)
print(response)
if __name__ == '__main__':
main()