Skip to content

Instantly share code, notes, and snippets.

@nagarindkx
Created July 28, 2021 08:20
Show Gist options
  • Select an option

  • Save nagarindkx/fe36a26bd867d1ae627ad0d69f6e6b4d to your computer and use it in GitHub Desktop.

Select an option

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
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