Skip to content

Instantly share code, notes, and snippets.

@antonbabenko
Created March 9, 2016 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonbabenko/9c0bbc0879c2618d73ab to your computer and use it in GitHub Desktop.
Save antonbabenko/9c0bbc0879c2618d73ab to your computer and use it in GitHub Desktop.
Debug SNS messages
<?php
// Fetch the raw POST body containing the message
$postBody = file_get_contents('php://input');
error_log($postBody);
// JSON decode the body to an array of message data
$message = json_decode($postBody, true);
if ($message) {
// Do something with the data
error_log($message['Message']);
error_log($message['SubscribeURL']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment