I am trying to install a webhook for leadgen event for my page via a facebook app. So I have:
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.