Giter Club home page Giter Club logo

facebook-asp.net-webhook's Introduction

Gitter

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.
    api

  • Following data is avaliable in the API
    post_data

Facebook App & Webhook Configuration

  • Navigate to https://developers.facebook.com

  • Choose Add a New App from the My Apps pull-down menu
    Add facebook app

  • Provide the display name, contact email address and click Create App ID
    New app

  • Navigate to Add Product and setup Webhook
    add product
    webhook

  • Select Page from the pull-down menu and click Subscribe to this topic
    subscription

  • Provide the callback URL (Note: SSL is mandatory), Verification Token and click Verify and Save
    subscription_config

  • On successfull verification you will be prompted with a list of avaliable subscriptions. From the list subscribe to Leadgen
    ledgen_subscribtion
    subscription_confirmation

  • To test the working without creating a lead ad do the following

    • Cick Test button in the leadgen subscription
      test_leadgen
    • Facebook will open-up a popup with sample data, click Send to My Server button.
      sample_data
    • If there is any valid method like sending email, writing to database etc is implemented in the API post will get executed.

License

This project is licensed under the MIT License

facebook-asp.net-webhook's People

Contributors

dependabot[bot] avatar somaraj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

facebook-asp.net-webhook's Issues

502 bad gateway

i need help i get 502 bad gateway, i have added the access token which i got from graph api in the token variable in the code also i am using ngrok after adding the url and the access token in the verify token it accepts it but when i try to test the leads ngrok gives me in the cmd " POST /api/webhooks 502 Bad Gateway" can you please tell me which step am i doing wrong , i appreciate your effort in this api ,Thanks

Shereen

bad request 400

Hi! Thank you for this solution! I follow each steps correctly and I try to log something on a text file. At the instruction:

await httpClientLead.GetStringAsync(formUrl)

log the error:

System.Net.Http.HttpRequestException: Il codice di stato della risposta non indica la riuscita dell'operazione: 400 (Bad Request).
in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
in FacebookLeadAdsWebhooks.Controller.WebhooksController.d__1.MoveNext() in C:\Users\xxxxx\Downloads\fb\Facebook-ASP.NET-Webhook-master\src\FacebookLeadAdsWebhooks\FacebookLeadAdsWebhooks\Controller\WebhooksController.cs:riga 74

Why?

Any code examples, please?

I'm new to all this Webhooks thing. Is there any chance of some code examples of how to use it and what it can do?

For example, do I have to do everything in the webhook or can I use a separate app to do things with the results I get back in the webhook?

Thanks

Facebook live information like email,mobileno

Hey somraj , i getting information leadgen Field Sample to my server , but i wanna to get live information data like name ,email,mobile. i try to get information by using Lead Ads Testing Tool. can we talk phone or whatsapp (contact no:-8208213320).Please help me

Access token about!

Hello Somaraj,

First off all thank you for sharing this solution.
I would like to ask you about how to get access token. I can verified my api url but can retrieved anything while testing the fields. There are too much token in facebook developer tool and i used your solution and didnt work for me.
I used this token below.

image

Thank you!

Issue : The URL couldn't be validated. Response does not match challenge, expected value

Hi SomaraJ, I am using your code but experiencing issues, when I try to register the callback url Im getting the following error.

The URL couldn't be validated. Response does not match challenge, expected value="39676783", received=""39676783""

I am thinking that this is caused by the Get request method when facebook is trying to validate the application.

Do you maybe know how I can fix this.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.