Skip to content

Instantly share code, notes, and snippets.

@guptag-dev
Created December 12, 2013 15:39
Show Gist options
  • Save guptag-dev/7929957 to your computer and use it in GitHub Desktop.
Save guptag-dev/7929957 to your computer and use it in GitHub Desktop.
php code to retrieve webhook
<?php
$request_body = file_get_contents('php://input');
$file = '/tmp/webhook_post.json';
$json = json_decode($request_body);
$event = $json->{"event"};
if( strcmp($event, "claim_acknowledgement") == 0) {
$claim_ack = "";
$claim_ack .= $json->{"acknowledgement"}->{"reference_id"} . PHP_EOL;
$claim_ack .= $json->{"acknowledgement"}->{"submission_status"} . PHP_EOL;
$claim_ack .= $json->{"acknowledgement"}->{"effective_date"} . PHP_EOL;
file_put_contents($file, $claim_ack);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment