What's wrong with my PHP code to validate Webhook Endpoint?

PHP7.4

I have entered the endpoint as myserver.com/mypath/myfile.php

in myfile.php:

$zoomData = json_decode(file_get_contents(‘php://input’), true);
$zoomSecret = ‘asdfsdfsdf’; //actual secret_id that I had got along with the client_id is entered here

$zoomPlainToken = $zoomData[‘payload’][‘plainToken’];
$sig = hash_hmac(‘sha256’, $zoomPlainToken, $zoomSecret);

$reponseData[‘plainToken’] = $zoomPlainToken;
$reponseData[‘encryptedToken’] = $sig;
echo json_encode($reponseData);

The validation always fails!

the $reponseData looks like this:

{
“plainToken”: “PfgPl4NVSQW_rGbmqH935Q”,
“encryptedToken”: “da33eccc18b883c91b4ed68d4d452b9d435d69a63370e2bac5ae67d1d7d46f59”
}

What is wrong? I can’t seem to get my head around this…

Thanks

AAARRRRRGGGGG

The “secret” is not the “client secret” but… the secret token on the same page where have to validate

DDDDUUUUUHHHH

The docs need to mention this specifically :slight_smile: or maybe it was just me

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