Created
July 28, 2021 08:20
-
-
Save nagarindkx/fe36a26bd867d1ae627ad0d69f6e6b4d to your computer and use it in GitHub Desktop.
Python code for Google Cloud Function to alert via LINE Notify by zoom webhook event
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 | |
| def callback(request): | |
| zoom_verification_token="ZOON_VERIFICATION_TOKEN" | |
| access_token='LINE_NOTIFY_TOKEN' | |
| re_auth=request.headers['authorization'] | |
| #if re_auth == zoom_verification_token:x | |
| if re_auth == re_auth: | |
| notify_url = 'https://notify-api.line.me/api/notify' | |
| header={ | |
| 'Content-Type':'application/x-www-form-urlencoded', | |
| 'Authorization': "Bearer " + access_token | |
| } | |
| data = { | |
| 'message': f"""มีคนเข้ามาในห้อง Zoom""" | |
| } | |
| profile_response = requests.post( | |
| notify_url, | |
| headers=header, | |
| data=data | |
| ).json() | |
| return "OK" | |
| else: | |
| pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment