# Validation of webhook endpoint url not working

**URL:** <https://devforum.zoom.us/t/validation-of-webhook-endpoint-url-not-working/99615>\
**Category:** API and Webhooks\
**Tags:** webhooks, s2s-oauth\
**Created:** [December 6, 2023, 8:03am UTC](https://devforum.zoom.us/t/validation-of-webhook-endpoint-url-not-working/99615 "2023-12-06T08:03:24Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![shlomi.fenster](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@shlomi.fenster](https://devforum.zoom.us/u/shlomi.fenster)\
**Post date:** [December 6, 2023, 8:03am UTC](https://devforum.zoom.us/t/validation-of-webhook-endpoint-url-not-working/99615/1 "2023-12-06T08:03:24Z")

</div>

Hi there!  
I’ve recently migrated to s2s-oauth as a replacement to my jwt app, and I’m now at the point of adding webhook notifications.  
I’ve got my endpoint set up properly I think (didn’t actually change anything from the working jwt endpoint code), but when I input the endpoint-url in the app definitions and click “validate” the validation fails.  
I looked at the logs of my endpoint, and I see the post-request, I see the 200 response, and things seem to be working, but the validation step still fails…  
What am I doing wrong?

(For what it’s worth, my endpoint is on pythonanywhere and is implemented using flask).

Thanks!

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [December 6, 2023, 9:44am UTC](https://devforum.zoom.us/t/validation-of-webhook-endpoint-url-not-working/99615/2 "2023-12-06T09:44:12Z")

</div>

@shlomi.fenster Hope you will be fine.

[Here](https://www.youtube.com/watch?v=wJ-xKEKlncY) is the session on how to enable Zoom Webhook.

---

<div class="post-metadata">

**Author:** ![shlomi.fenster](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@shlomi.fenster](https://devforum.zoom.us/u/shlomi.fenster)\
**Post date:** [December 6, 2023, 10:38am UTC](https://devforum.zoom.us/t/validation-of-webhook-endpoint-url-not-working/99615/3 "2023-12-06T10:38:51Z")

</div>

I don’t understand. I need to use the secret token thing now? The jwt app didn’t have that, so this is new to me.  
Is there a python example as to what I should be doing on my endpoint flask app?

---

<div class="post-metadata">

**Author:** ![shlomi.fenster](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@shlomi.fenster](https://devforum.zoom.us/u/shlomi.fenster)\
**Post date:** [December 6, 2023, 11:24am UTC](https://devforum.zoom.us/t/validation-of-webhook-endpoint-url-not-working/99615/4 "2023-12-06T11:24:12Z")

</div>

Do I understand correctly that using the x-zm-signature and the secret token stuff are something that I can optionally use in order to validate that the request indeed came from my zoom-app-webhook?  
Why would “skipping” this stage and just returning a 200-status response culminate in the validation failing? How would my s2s-oauth app even know if I checked the x-zm-signature??  
I think the issue is something else.  
Again - I recieve the post-request at my endpoint url, and do whatever it is I want to do (save a json of the request data or something) and then return a flask.Response(200).  
Why would this fail? Even removing the middle part and just immediatly returning a 200-response is failing validation…

---

<div class="post-metadata">

**Author:** ![shlomi.fenster](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@shlomi.fenster](https://devforum.zoom.us/u/shlomi.fenster)\
**Post date:** [December 6, 2023, 11:32am UTC](https://devforum.zoom.us/t/validation-of-webhook-endpoint-url-not-working/99615/5 "2023-12-06T11:32:51Z")

</div>

Here, the most simple form of failure is even doing this:

```auto
from flask import Flask, request, Response

app = Flask( __name__ )

@app.route('/new_zoom_recording_available/', methods=['POST'])
def run_main_new_zoom_recording_available():
    return Response(status=200)

```

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [December 6, 2023, 11:46am UTC](https://devforum.zoom.us/t/validation-of-webhook-endpoint-url-not-working/99615/6 "2023-12-06T11:46:17Z")

</div>

@shlomi.fenster DM me.

---

<div class="post-metadata">

**Author:** ![shlomi.fenster](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@shlomi.fenster](https://devforum.zoom.us/u/shlomi.fenster)\
**Post date:** [December 6, 2023, 12:28pm UTC](https://devforum.zoom.us/t/validation-of-webhook-endpoint-url-not-working/99615/7 "2023-12-06T12:28:50Z")

</div>

This is embarrasing, but how do I send a direct message?? 🤦‍♂️ 😂

---

<div class="post-metadata">

**Author:** ![shlomi.fenster](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@shlomi.fenster](https://devforum.zoom.us/u/shlomi.fenster)\
**Post date:** [December 6, 2023, 6:46pm UTC](https://devforum.zoom.us/t/validation-of-webhook-endpoint-url-not-working/99615/8 "2023-12-06T18:46:19Z")

</div>

Um, anyone? What am I missing?

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [December 7, 2023, 9:39am UTC](https://devforum.zoom.us/t/validation-of-webhook-endpoint-url-not-working/99615/9 "2023-12-07T09:39:06Z")

</div>

Please ping/DM me via my WhatsApp you will get that by clicking my profile image.

 ![Screenshot 2023-12-07 at 2.38.42 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/1/f/1fcd43d9b2f96dd96b467f9d3d6a8f412e6157dc.jpeg)

---

<div class="post-metadata">

**Author:** ![shlomi.fenster](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@shlomi.fenster](https://devforum.zoom.us/u/shlomi.fenster)\
**Post date:** [December 7, 2023, 9:29pm UTC](https://devforum.zoom.us/t/validation-of-webhook-endpoint-url-not-working/99615/10 "2023-12-07T21:29:05Z")

</div>

Ok, I’ve made some progress, reread the documentation, and I’ve tried implementing the necessary code, but I’m doing something wrong because my calculation of the x-zm-signature is not managing to recreate the x-zm-signature in the request.  
Here’s (a snippet of ) my code, please tell me what I’m doing wrong:

```auto
request_body = request.get_json(force=True)

x_zm_signature = request.headers['x-zm-signature']

message = f"v0:{request.headers['x-zm-request-timestamp']}:{json.dumps(request_body)}"
hashed_message = hmac.new(bytes(ZOOM_SECRET_TOKEN, 'latin-1'),
                          msg=bytes(message, 'latin-1'),
                          digestmod=hashlib.sha256).hexdigest()
signature = f"v0={hashed_message}"

# But signature != x_zm_signature :-(

```

Thanks!

---

<div class="post-metadata">

**Author:** ![ymnoor21](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ymnoor21/32/52939_2.png) [@ymnoor21](https://devforum.zoom.us/u/ymnoor21)\
**Post date:** [December 7, 2023, 9:47pm UTC](https://devforum.zoom.us/t/validation-of-webhook-endpoint-url-not-working/99615/11 "2023-12-07T21:47:10Z")

</div>

> [@shlomi.fenster](#):
>
> Is there a python example as to what I should be doing on my endpoint flask app?

Can you try this? I feel like json.dumps need **seperators** param and **ensure\_ascii** flag **false**. We ran into an issue with spanish accent characters in the payload. ensure\_ascii=false fixed that issue.

```Python
x_zm_signature = headers['X-Zm-Signature']
x_zm_request_timestamp = request.headers['X-Zm-Request-Timestamp']

json_request = json.dumps(
    request_body, separators=(",", ":"), ensure_ascii=False)

secret_token = bytes(ZOOM_SECRET_TOKEN, 'utf-8')

message = "v0:{}:{}".format(
    x_zm_request_timestamp, json_request).encode('utf-8')

hashed_message = hmac.new(
    secret_token, msg=message,
    digestmod=hashlib.sha256).hexdigest()

signature = "v0={}".format(hashed_message)

# Signatures mismatch check
if x_zm_signature != signature:
    # stuff after signature mismatch

```

---

<div class="post-metadata">

**Author:** ![shlomi.fenster](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@shlomi.fenster](https://devforum.zoom.us/u/shlomi.fenster)\
**Post date:** [December 8, 2023, 5:43am UTC](https://devforum.zoom.us/t/validation-of-webhook-endpoint-url-not-working/99615/12 "2023-12-08T05:43:18Z")

</div>

Yes!!! This did it! Thank you very very much!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [December 9, 2023, 5:43am UTC](https://devforum.zoom.us/t/validation-of-webhook-endpoint-url-not-working/99615/13 "2023-12-09T05:43:45Z")

</div>

Closed on December 9, 2023, 5:43am UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
