Webhooks
Webhook Setup
Webhook URL
Signing Key
<?php
if (strtoupper($_SERVER['REQUEST_METHOD']) != 'POST' || !in_array('HTTP_X_SIGNATURE_HASH', $_SERVER)) {
exit();
}
// Get the input from the request.
$input = @file_get_contents("php://input");
// Replace SIGNING_KEY with the signing key from your account
define('GLYDE_SIGNING_KEY', 'SIGNING_KEY');
// Validate the authenticity of the data sent
if ($_SERVER['HTTP_X_SIGNATURE_HASH'] !== hash_hmac('sha256', $input, GLYDE_SIGNING_KEY)) {
exit();
}
// Send an HTTP success response back to Glyde
http_response_code(200);
//Decode the JSON string and convert it to an associative array.
$event = json_decode($input, true);
// **(Optional Processing Placeholder):**
// Add your code here to process the data in the $event variable
exit();
Last updated