Skip to content

Instantly share code, notes, and snippets.

@stephangroen stephangroen/webhookreceive.php Secret
Created Oct 17, 2013

Embed
What would you like to do?
Receiving a JSON hook
<?php
// Fetch the entire body to a variable (this will contain the raw data)
$webhook = file_get_contents('php://input');
// Decode the JSON to an array
$webhook_array = json_decode($webhook, true);
// Do some stuff with the data you received, for example write contents to a file
file_put_contents('webhook.txt', print_r($webhook_array, true));
// Send a success header, so Picqer knows you have succesfully received the data
header('HTTP/1.1 200 OK');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.