Webhook endpoint url is not validating it is throwing error

When we are validating the webhook endpoint in PHP it throws the error, the return type is invalid but we are returning the correct JSON object as per the endpoint validation documentation.

We are using below PHP code to validate the webhook endpoint URL:-

$body = file_get_contents(‘php://input’);
$params = json_decode($body, true);
$plainToken = $params[‘payload’][‘plainToken’];
$secretToken = “SECRET_TOKEN”;
$message = $plainToken;
$secretTokenByte = utf8_encode($secretToken);
$messageBytes = utf8_encode($message);
$hashmessage = hash_hmac(“sha256”, $messageBytes, $secretTokenByte, true);
$hexMessage = implode(“”, array_map(function ($x) {
return sprintf(“%02x”, $x);
}, unpack(“C*”, $hashmessage)));
$response = [
“plainToken” => $plainToken,
“encryptedToken” => $hexMessage
return json_encode($response);

Please help us regarding the above issue.

Also, we have checked the code multiple times as per the webhook validation documentation

Hi @marc.moreno
Thanks for reaching out to us
Have you taken a look at our sample app here:

It looks like you are probably missing the validating the signature step

Hi Elisa,

Thank you. as per my developer “=> We have validated the signature as Zoom support suggested, But we are getting the same error when validating the webhook, So kindly ask to Zoom support team why we are getting the “Invalid return type” error” could you please advise? Thank you!

Thanks @marc.moreno
Can you ask your developer to look at the sample app I shared and run it locally and try to replicate the code on php

Thank you so much. I will tell them that.

1 Like