Facebook-ASP.NET-Webhook
Facebook-ASP.NET-Webhook copied to clipboard
Retrieving facebook leads using ASP.NET Web API and Graph API Webhooks
Retrieving facebook leads using ASP.NET Web API and Graph API Webhooks
ASP.NET way of retrieving Facebook Lead Ad data
Prerequisites
- Facebook developer account
- Visual Studio 2015 or higher
Web API Implementation
-
Compile and host the Web API in your server
Note: SSL Certificate is mandatory. Facebook accept only https URL. -
When an lead ad is generated facebook will post the data to the Web API's Post action.
-
Following data is avaliable in the API
Facebook App & Webhook Configuration
-
Navigate to https://developers.facebook.com
-
Choose Add a New App from the My Apps pull-down menu
-
Provide the display name, contact email address and click Create App ID
-
Navigate to Add Product and setup Webhook
-
Select Page from the pull-down menu and click Subscribe to this topic
-
Provide the callback URL (Note: SSL is mandatory), Verification Token and click Verify and Save
-
On successfull verification you will be prompted with a list of avaliable subscriptions. From the list subscribe to Leadgen
-
To test the working without creating a lead ad do the following
- Cick Test button in the leadgen subscription
- Facebook will open-up a popup with sample data, click Send to My Server button.
- If there is any valid method like sending email, writing to database etc is implemented in the API post will get executed.
- Cick Test button in the leadgen subscription
License
This project is licensed under the MIT License