Skip to main content
The platform sends the signature in the X-Telehealth-Signature header in lowercase hexadecimal (no prefix). You must compute HMAC-SHA256 of the raw body (UTF-8) with your secret and compare in lowercase hex.
<?php
function verifyWebhookSignature(string $rawBody, string $signatureHeader, string $secret): bool {
    $expected = hash_hmac('sha256', $rawBody, $secret, false); // false = lowercase hex
    return hash_equals($expected, $signatureHeader);
}

// In your webhook endpoint:
$rawBody = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_TELEHEALTH_SIGNATURE'] ?? '';
$secret = 'YOUR_WEBHOOK_SECRET';

if (!verifyWebhookSignature($rawBody, $signature, $secret)) {
    http_response_code(401);
    exit('Invalid signature');
}
$payload = json_decode($rawBody, true);
// Process $payload according to $payload['event'] or X-Telehealth-Event header