Receiving Facebook Leads on a Webhook
100,000 so'm
2020 IMPORTANT UPDATE - READ THIS BEFORE CONTINUING
THis gist was created in 2016 and I haven't been working with Facebook Leads ever since. As a result, this guide might not be accurate.
Please check @eladnava's updated step-by-step guide for 2020 here: https://eladnava.com/get-facebook-ad-lead-notifications-in-realtime-with-node-js-webhooks/
1 - Create an App
Head over to developer.facebook.com and create an App
2 - Setup the webhook
On your server, create a facebook webhook that will handle facebook calls. Then create a "leadgen" webhook on you App: https://developers.facebook.com/docs/graph-api/webhooks/v2.5
3 - Get an access token
Get lifetime access token to App (I asked for the following permissions: manage_pages, publish_pages, publish_actions, public_profile)