I am working with an aws ec2 server (ubuntu). It is set to open so for all traffic. I am trying to get my Webhook from HubSpot to connect to my php page for collecting data. I have tested this webhook with the recommended RequestBin site and all the data comes through just fine. So this leads to think its my code or maybe the use of the SSL on the server that is used to connect to it via terminal.
my php code is ...
<?php
# taking data from HubSpot's webhook
//$hookData = json_decode(file_get_contents("php://input"), ture);
//$_POST = json_decode(file_get_contents("http://requestb.in/150jn861")); // does not get anything
//$_POST = file_get_contents('http://requestb.in/150jn861'); // writes to file the string "ok"
$_POST = json_decode(file_get_contents("php://input"), ture);
$file = fopen("datadump1.txt", "w");
fwrite($file, $_POST);
fclose($file);
var_dump($_POST); // test input
echo "\nTest completed\n";
?>
I have found 2 other posts on here for webhooks and hubspot but the fix did not work. As you can see I have been testing multiple things but have not gotten anything to work. Since this is aws ec2 I cannot use the var_dump or echo to really test as good as I would like. I have never used this type of environment before. Thank you in advance for any help you can give.