Hi all!
I’ve recently migrated from jwt-authentication to s2s-oauth, and I’ve rewritten most of the required code on my url-endpoint accordingly.
I’ve passed the url-endpoint-validation part, and wanted to test my actuall events, but I don’t seem to be getting anything incoming from the webhook.
E.g., I have a “recording has been deleted (removed to trash)” event, and so I went ahead and deleted a recording, but no event was sent to my webhook url flask app.
I’ve simplified things for the sake of just logging such events, but obviously if nothing comes through then that doesn’t really help debug.
What should I check? What might I be doing wrong?
Here’s some info so we can jump straight to the interesting problems and skip the obvious mistakes:
Example event checked -
Url has been validated -
And some (simplified) code -
@app.route('/zoom_recordings_webhook/', methods=['POST'])
def run_main_new_zoom_recording_available():
request_body = request.get_json(force=True)
request_body_str = json.dumps(request_body, separators=(",", ":"), ensure_ascii=False)
x_zm_signature = request.headers['x-zm-signature']
message = f"v0:{request.headers['x-zm-request-timestamp']}:{request_body_str}"
hashed_message = hmac.new(bytes(ZOOM_SECRET_TOKEN, 'latin-1'),
msg=bytes(message, 'latin-1'),
digestmod=hashlib.sha256).hexdigest()
signature = f"v0={hashed_message}"
if x_zm_signature == signature:
if request_body['event'] == 'endpoint.url_validation':
plain_token = request_body['payload']['plainToken']
hash_for_validation = hmac.new(bytes(ZOOM_SECRET_TOKEN, 'latin-1'),
msg=bytes(plain_token, 'latin-1'),
digestmod=hashlib.sha256).hexdigest()
response = json.dumps({'plainToken': plain_token, 'encryptedToken': hash_for_validation})
return Response(response=response, status=200)
else:
print(request_body)
print('===============================')
print(list(request.headers.keys()))
print('###############################')
else:
print('Nope...')
print(signature)
print(x_zm_signature)
print('***************************************')
I’ve also looked at the app dashboards on the zoom-app-market, and I don’t see any POST requests, but I’m not sure how indicative that is…
Thanks in advance!
Shlomi