0

I have Wix ( Editor X ) website that generated webhooks for notifications. I want to save these data into amocrm. However, before saving data I tried to catch the webhook and see what is coming from it. In order to catch incoming webhook I used php and upload my php file in https://www.example.com/webhook.php directory and assigned this into Callback Url. However, when I try to POST the url in POSTMAN, I am getting an empty data. Below what I included into my file.

<?php
if($json = json_decode(file_get_contents("php://input"), true)) {
print_r($json);
$data = $json;
} else{
$data = $json;
print_r($data);
}

?>
ba-a-aton
  • 574
  • 1
  • 4
  • 14
Junior
  • 73
  • 1
  • 10
  • You shouldn't be decode JSON if you just want to look what you get. Perhaps it is not JSON you get. Also I would try [$_REQUEST](https://www.php.net/manual/en/reserved.variables.request.php) instead of `file_get_contents("php://input")`. See also [PHP “php://input” vs $_POST](https://stackoverflow.com/questions/8893574/php-php-input-vs-post) – KIKO Software Aug 19 '21 at 14:10
  • Why is this tagged as `nodejs`? – Martin Zeitler Aug 21 '21 at 04:52

0 Answers0