Event notification endpoint URL - URL validation failed. Try again later Webhook Only App

I am getting the url validation error. I am using Java in a jsp page, and my code is as such, and I display both versions that I have tried:

Mac mac = Mac.getInstance(“HmacSHA256”);
SecretKeySpec secretKeySpec = new SecretKeySpec(secretToken.getBytes(StandardCharsets.UTF_8), “HmacSHA256”);
mac.init(secretKeySpec);

byte hash = mac.doFinal(plainToken.getBytes(StandardCharsets.UTF_8));
String encryptedToken = bytesToHex(hash).toLowerCase();

out.println(“{ "message": { "plainToken":"” + plainToken + “", "encryptedToken": "” +encryptedToken + “" }, "status": 200 }”);

	        // or //

out.println(200);
JSONObject jsonResponse = new JSONObject();
jsonResponse.addProperty(“plainToken”, plainToken);
jsonResponse.addProperty(“encryptedToken”, encryptedToken);
response.status(200);
response.type(“application/json”);
return jsonResponse;

Hi Tommy can you resolve this why mw signature and header x-zm-signature not matching here is the code that i am using in a lambda function

import crypto from “crypto”

export const handler = async(event) => {
// Get the verification token from the Zoom App dashboard
const zoomVerificationToken = process.env.ZOOM_VERIFICATION_TOKEN;

// Get the headers from the incoming webhook event
const headers = event.headers;
const body = event.body;
console.log(“Incoming Headers”,headers)
console.log(“Incoming Body”,body)
const message = v0:${headers['x-zm-request-timestamp']}:${JSON.stringify(body)}

const hashForVerify = crypto.createHmac(‘sha256’, process.env.ZOOM_VERIFICATION_TOKEN).update(message).digest(‘hex’)

// hash the message string with your Webhook Secret Token and prepend the version semantic
const signature = v0=${hashForVerify}

console.log(“Constructed Signature”,signature)

const zoomSignature = headers[‘x-zm-signature’]

console.log(“ZOOM SIGNATURE”,zoomSignature)

return {
  statusCode: 401,
  body: 'Invalid signature',
};

};

Hi, I was facing the same issue.

For me it’s because I was using bodyParser.raw() instead of bodyParser.json().

Hope this can help.