This is a sample code (C# ASP.NET Core) for Facebook's Webhook and Lead Ads's products, focused on retrieving the leads. This sample code was also used in an internal training here at Facebook, as a demo session. You also have a Postman collection in the postman
folder for testing purposes.
This repo is related to the (C#) REST webservice module (Back-End), leveraging AWS SAM accelerator. I believe this can be easily ported to other cloud providers, because the focus is on the webhook's endpoints.
Based on the ASP.NET Core Web API Serverless Application template.
Created by M. França - Solutions Architect (Solutions Engineering team LATAM).
Get this source code...
git clone
Install the AWS templates and tools for your VS Code installation...
dotnet new --install Amazon.Lambda.Templates
dotnet tool install –g Amazon.Lambda.Tools
Retrieve the project's dependencies, compile everything, and run it locally...
dotnet restore
dotnet run
Validate the SAM yaml file, then package everything, and finally deploy it to the AWS cloud...
sam validate --template-file aws_iaac.yaml
dotnet lambda package --output-package .aws-sam\build\MyAWSomeLambda\prjFBLeadAds.zip
sam deploy --guided --template-file aws_iaac.yaml
Monitor the logs to find the id of your new lead...
sam logs -n MyAWSomeLambda --stack-name fra-fbleadads-back-stk --tail --region sa-east-1
dotnet new serverless.AspNetCoreWebAPI --name prjFBLeadAds –o .
dotnet restore
dotnet run
dotnet lambda package --output-package .aws-sam\build\MyAWSomeLambda\prjFBLeadAds.zip
sam deploy --guided --template-file aws_iaac.yaml
aws cloudformation delete-stack --stack-name sam-app --region region
- Facebook Webhooks
- Retrieving Leads API
- AWS Command Line Interface
- AWS Serverless Application Model (SAM)
- Postman for testing API calls
This source code is licensed under the MIT License. See the LICENSE
file.
This project is waiting for your contribution. See the CONTRIBUTING.md
file.
Marcelo França - www.linkedin.com/in/mafranca