Facebook sends empty POST to a webhook

Facebook sends webhook data as Content-Type: application/json, not as …: application/x-www-form-urlencoded (as a normal form with method=post would.)

Therefor, PHP does not populate $_POST – you need to read the raw input stream instead. That can be done using file_get_contents('php://input') – and then just apply json_decode on that data, and you’ll have a proper data structure to work with.


Facebook sends the leads data in the request body. If you are using a framework, please check if you have access to the request body. Try using a third party intermediate service like Runscope to see the full request, it is very usef


In case you are using the django framework, you should request.body, as post data will remain empty.

def webhook_response(request):
   # it will print the contents from facebook webhook response
   print(request.body)

   # something like the following object will print up if you are using leadgen
   {"object": "page", "entry": [{"id": "0", "time": 111111111, "changes": [{"field": "leadgen", "value": {"ad_id": "444444444", "form_id": "444444444444", "leadgen_id": "444444444444", "created_time": 11111111, "page_id": "444444444444", "adgroup_id": "44444444444"}}]}]}