# Webhook url validation failing for a REST endpoint created using AWS Amplify and handled using AWS Lambda

**URL:** <https://devforum.zoom.us/t/webhook-url-validation-failing-for-a-rest-endpoint-created-using-aws-amplify-and-handled-using-aws-lambda/99476>\
**Category:** API and Webhooks\
**Tags:** webhooks\
**Created:** [December 4, 2023, 11:36am UTC](https://devforum.zoom.us/t/webhook-url-validation-failing-for-a-rest-endpoint-created-using-aws-amplify-and-handled-using-aws-lambda/99476 "2023-12-04T11:36:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aayush](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/aayush/32/50555_2.png) [@aayush](https://devforum.zoom.us/u/aayush)\
**Post date:** [December 4, 2023, 11:36am UTC](https://devforum.zoom.us/t/webhook-url-validation-failing-for-a-rest-endpoint-created-using-aws-amplify-and-handled-using-aws-lambda/99476/1 "2023-12-04T11:36:11Z")

</div>

I’m trying to validate a webhook URL but its not succeeding. I can’t give the exact endpoint URL, but its something like this: https://$$$execute-api.us-east-1.amazonaws.com/env/endpoint-url

This is a REST endpoint which I created using AWS Amplify (using amplify update api command of the Amplify CLI). The http requests sent at this endpoint is handled by a lambda function which I created for this purpose. In the lambda, I’m handling the event of `url_verification` by creating the HMAC-SHA256 hash as following (similar to the steps described here: [https://github.com/zoom/webhook-sample/blob/master/index.js](https://github.com/zoom/webhook-sample/blob/master/index.js))

```auto
body = JSON.parse(event.body);
if (body.event === "endpoint.url_validation") {
        const hashForValidate = crypto.createHmac('sha256', ZOOM_WEBHOOK_SECRET_TOKEN).update(body.payload.plainToken).digest('hex');

        const response = {
            message: {
                plainToken: body.payload.plainToken,
                encryptedToken: hashForValidate
            },
            status: 200
        };

        console.log("Generated url validation response:", JSON.stringify(response, null, 5));
        return response;
    }

```

Still I’m getting failed URL validation. How do I get it working? Do I need to do something different when working inside an aws lambda function?

@chunsiong.zoom Can you help me here?

---

<div class="post-metadata">

**Author:** ![ojus.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ojus.zoom/32/734_2.png) [@ojus.zoom](https://devforum.zoom.us/u/ojus.zoom)\
**Post date:** [December 7, 2023, 5:22pm UTC](https://devforum.zoom.us/t/webhook-url-validation-failing-for-a-rest-endpoint-created-using-aws-amplify-and-handled-using-aws-lambda/99476/2 "2023-12-07T17:22:00Z")

</div>

@aayush do you see the incoming request from Zoom when you click the validate button?

---

<div class="post-metadata">

**Author:** ![aayush](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/aayush/32/50555_2.png) [@aayush](https://devforum.zoom.us/u/aayush)\
**Post date:** [December 8, 2023, 5:45am UTC](https://devforum.zoom.us/t/webhook-url-validation-failing-for-a-rest-endpoint-created-using-aws-amplify-and-handled-using-aws-lambda/99476/3 "2023-12-08T05:45:41Z")

</div>

Yes I can see the incoming request from zoom. But not at the place where I click the validate button. I’ve added a `console.log` in my lambda function which outputs the `event` received (which is basically the entire HTTP data sent over on my REST api by zoom). I can see that payload inside the CloudWatch Logs, which basically stores all the output of my lambda, separated out based on different invocations at different times.

In short, yeah I can see the payload which is sent by Zoom, but not at the place where the validate button is shown to me.

---

<div class="post-metadata">

**Author:** ![ojus.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ojus.zoom/32/734_2.png) [@ojus.zoom](https://devforum.zoom.us/u/ojus.zoom)\
**Post date:** [December 8, 2023, 7:24am UTC](https://devforum.zoom.us/t/webhook-url-validation-failing-for-a-rest-endpoint-created-using-aws-amplify-and-handled-using-aws-lambda/99476/4 "2023-12-08T07:24:38Z")

</div>

Can you confirm that the `ZOOM_WEBHOOK_SECRET_TOKEN` is correctly configured and matches the secret token provided by Zoom. The HMAC-SHA256 hash generation should use the exact secret token without any modifications. If this does not work, let me know some timings that would work for you starting next tuesday, would love to jump on a meeting to debug this. I will be in IST though

---

<div class="post-metadata">

**Author:** ![aayush](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/aayush/32/50555_2.png) [@aayush](https://devforum.zoom.us/u/aayush)\
**Post date:** [December 8, 2023, 7:39am UTC](https://devforum.zoom.us/t/webhook-url-validation-failing-for-a-rest-endpoint-created-using-aws-amplify-and-handled-using-aws-lambda/99476/5 "2023-12-08T07:39:38Z")

</div>

Yes. I can confirm that the zoom webhook secret token which I’m using is the same as shown to me in the webhook url validation page. I copied and pasted it in plaintext in my lambda (since, I was only testing it).  
I’m available on Dec 12th (coming Tuesday)… from 12PM to 2PM, then from 4PM to 7PM (all times in IST). Would be very helpful of you if we can resolve this on a call.

Thanks a lot.

---

<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 10, 2024, 11:16pm UTC](https://devforum.zoom.us/t/webhook-url-validation-failing-for-a-rest-endpoint-created-using-aws-amplify-and-handled-using-aws-lambda/99476/6 "2024-12-10T23:16:17Z")

</div>

Closed on December 10, 2024, 11:16pm UTC

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