Webhooks PHP help

Hello,

I thought I’d provide some help for others implementing webhooks where the endpoint is a PHP script. For a while we were seeing nothing in the webhook being sent by QF but this is because a JSON webhook contains no HTTP headers and therefore the data is not available in the $_REQUEST variable as usual.

The trick is to use the following code to take the input stream into a variable:

$json = file_get_contents(“php://input”);
$data = json_decode($json, 1);

Then you can work with it, check the md5 signature and look into the contents of the webhook.

I hope that helps someone.

Richard.

2 Likes