# Webhook not getting data

**URL:** <https://forum.mautic.org/t/webhook-not-getting-data/4302>\
**Category:** Product Support\
**Created:** [June 21, 2016, 8:32am UTC](https://forum.mautic.org/t/webhook-not-getting-data/4302 "2016-06-21T08:32:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pramod](https://avatars.discourse-cdn.com/v4/letter/p/71c47a/32.png) [@pramod](https://forum.mautic.org/u/pramod)\
**Post date:** [June 21, 2016, 8:32am UTC](https://forum.mautic.org/t/webhook-not-getting-data/4302/1 "2016-06-21T08:32:39Z")

</div>

Hello Team,  
  
I am configured mautic web hook and selected event as new contact . But i am not getting any data to provided webhook url, when new contect is created.  
  
Here is the sample code :-

Code:

 $file = 'people.txt'; // Open the file to get existing content $current = file\_get\_contents($file); // Append a new person to the file foreach ($\_POST as $key =\> $value) { $current .= "Field ".htmlspecialchars($key)." is ".htmlspecialchars($value)."  
"; } // Write the contents back to the file file\_put\_contents($file, $current);

  
Is i am doing anything wrong ?

---

<div class="post-metadata">

**Author:** ![pramod](https://avatars.discourse-cdn.com/v4/letter/p/71c47a/32.png) [@pramod](https://forum.mautic.org/u/pramod)\
**Post date:** [June 21, 2016, 8:32am UTC](https://forum.mautic.org/t/webhook-not-getting-data/4302/2 "2016-06-21T08:32:39Z")

</div>

Hello Team,  
I am configured mautic web hook and selected event as new contact . But i am not getting any data to provided webhook url, when new contect is created.  
Here is the sample code :-

```auto
 $file = 'people.txt';
// Open the file to get existing content
$current = file_get_contents($file);
// Append a new person to the file
foreach ($_POST as $key => $value)
{
 	$current .= "Field ".htmlspecialchars($key)." is ".htmlspecialchars($value)."<br>";
}
// Write the contents back to the file
file_put_contents($file, $current);
```

Is i am doing anything wrong ?

---

<div class="post-metadata">

**Author:** ![robsondantas](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@robsondantas](https://forum.mautic.org/u/robsondantas)\
**Post date:** [November 15, 2016, 2:12pm UTC](https://forum.mautic.org/t/webhook-not-getting-data/4302/3 "2016-11-15T14:12:03Z")

</div>

Wrong way to receive data.

You should be doing:  
$postdata = file\_get\_contents(“php://input”);  
file\_put\_contents($file, $postdata);
