# Unable to validate the webhook URL in Python

**URL:** <https://devforum.zoom.us/t/unable-to-validate-the-webhook-url-in-python/82094>\
**Category:** Meetings\
**Tags:** webhooks, api\
**Created:** [January 25, 2023, 10:17am UTC](https://devforum.zoom.us/t/unable-to-validate-the-webhook-url-in-python/82094 "2023-01-25T10:17:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lazieindie](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@lazieindie](https://devforum.zoom.us/u/lazieindie)\
**Post date:** [January 25, 2023, 10:17am UTC](https://devforum.zoom.us/t/unable-to-validate-the-webhook-url-in-python/82094/1 "2023-01-25T10:17:55Z")

</div>

**Description**  
I’m using Zoom JWT application and I’m trying to subscribe to events while subscribing events I’m passing web hook as a parameter in the features. Event subscription web hook is returning as Invalid URL. My web hook API is written in python 3. If anyone can share the python code snippet to validate the web hook API it could be appropriated.

**Error?**  
URL Validation failed. Try again later

**Code Snippet**  
webhook\_token = os.environ.get(‘ZOOM\_WEBHOOK\_SECRET\_TOKEN’)  
token = webhook\_token.encode(“utf-8”)  
plainToken = request.json.get(“payload”).get(“plainToken”).encode(“utf-8”)  
hashForValidate = hmac.new(token,plainToken,hashlib.sha256()).hexdigest()  
return ({  
“plainToken”: plainToken,  
“encryptedToken”: hashForValidate  
})

---

<div class="post-metadata">

**Author:** ![Alexandra](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/alexandra/32/39489_2.png) [@Alexandra](https://devforum.zoom.us/u/Alexandra)\
**Post date:** [January 25, 2023, 9:14pm UTC](https://devforum.zoom.us/t/unable-to-validate-the-webhook-url-in-python/82094/2 "2023-01-25T21:14:24Z")

</div>

Try passing `hashlib.sha256` into the `hmac.new` function instead of `hashlib.sha256()`.

---

<div class="post-metadata">

**Author:** ![lazieindie](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@lazieindie](https://devforum.zoom.us/u/lazieindie)\
**Post date:** [January 30, 2023, 5:19am UTC](https://devforum.zoom.us/t/unable-to-validate-the-webhook-url-in-python/82094/3 "2023-01-30T05:19:29Z")

</div>

```
        plainToken = request.json.get("payload").get("plainToken").encode("utf-8")
        hashForValidate = hmac.new(token,plainToken,hashlib.sha256).hexdigest()
       return ({
            "plainToken": plainToken,
            "encryptedToken": hashForValidate
          })

```

Above code snippet also not working
