# Facing issue while Validating WebHook to my URL in PHP

**URL:** <https://devforum.zoom.us/t/facing-issue-while-validating-webhook-to-my-url-in-php/89029>\
**Category:** API and Webhooks\
**Created:** [May 25, 2023, 10:55am UTC](https://devforum.zoom.us/t/facing-issue-while-validating-webhook-to-my-url-in-php/89029 "2023-05-25T10:55:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam6](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@sam6](https://devforum.zoom.us/u/sam6)\
**Post date:** [May 25, 2023, 10:55am UTC](https://devforum.zoom.us/t/facing-issue-while-validating-webhook-to-my-url-in-php/89029/1 "2023-05-25T10:55:34Z")

</div>

My backend the PHP and I have added a logic to implement webhook with my URL. But webhook is not able to validate.

Below is my code. Here I have hide my secret. My both the variables are matching encryptedToken and ZoomSignature. Please guide me further.

$secret = “This is removed for security purpose”;  
if ($\_SERVER[‘REQUEST\_METHOD’] == ‘POST’){  
$data = file\_get\_contents(“php://input”);  
$webinar\_array = json\_decode($data);  
// $GLOBALS[‘log’]-\>fatal(“webinar\_array=”.print\_r($webinar\_array,1));  
$string = $webinar\_array-\>payload-\>plainToken;  
$timestamp = $\_SERVER[‘HTTP\_X\_ZM\_REQUEST\_TIMESTAMP’];

```
$message = "v0:".$timestamp.":".$data;
$GLOBALS['log']->fatal("message=".$message);

$encryptedToken = hash_hmac('sha256', $message, $secret);
$encryptedToken = "v0=".$encryptedToken;	

$ZoomSignature = $_SERVER['HTTP_X_ZM_SIGNATURE'];
// $GLOBALS['log']->fatal("server=".print_r($_SERVER,1));	
// Response HTTP status code when:
// 200: Correctly signed payload
// 401: Incorrectly signed payload	
// if (hash_equals($encryptedToken, $ZoomSignature)) {
if ($encryptedToken == $ZoomSignature) {	       
    http_response_code(200);
} else {
    http_response_code(401);
}
return true;

```

}

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [June 5, 2023, 7:33pm UTC](https://devforum.zoom.us/t/facing-issue-while-validating-webhook-to-my-url-in-php/89029/2 "2023-06-05T19:33:25Z")

</div>

Hi @sam6  
Thanks for reaching out to the Zoom Developer Forum and welcome to our community!  
Sorry for the late reply here! I just wanted to check in with you to see if you were able to troubleshoot this on your end or if you need some assistance here!  
Cheers,  
Elisa

---

<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:** [June 8, 2024, 11:09am UTC](https://devforum.zoom.us/t/facing-issue-while-validating-webhook-to-my-url-in-php/89029/3 "2024-06-08T11:09:40Z")

</div>

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