{"id":19399714,"url":"https://github.com/fbsamples/lead-ads-webhook-sample","last_synced_at":"2025-04-24T06:32:08.469Z","repository":{"id":39600499,"uuid":"410973393","full_name":"fbsamples/lead-ads-webhook-sample","owner":"fbsamples","description":"Sample code to accelerate client's adoption of Lead Ads and Conversion Leads products, by integrating with our advertising platform. Developers can also take this as reference when building integrations, without having to start from scratch.","archived":false,"fork":false,"pushed_at":"2024-10-22T23:33:36.000Z","size":9680,"stargazers_count":18,"open_issues_count":0,"forks_count":7,"subscribers_count":29,"default_branch":"main","last_synced_at":"2025-04-03T00:41:14.877Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fbsamples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-27T17:07:37.000Z","updated_at":"2025-03-13T16:26:57.000Z","dependencies_parsed_at":"2024-08-05T18:04:30.745Z","dependency_job_id":null,"html_url":"https://github.com/fbsamples/lead-ads-webhook-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbsamples%2Flead-ads-webhook-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbsamples%2Flead-ads-webhook-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbsamples%2Flead-ads-webhook-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbsamples%2Flead-ads-webhook-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fbsamples","download_url":"https://codeload.github.com/fbsamples/lead-ads-webhook-sample/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250578363,"owners_count":21453297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T11:10:57.138Z","updated_at":"2025-04-24T06:32:07.779Z","avatar_url":"https://github.com/fbsamples.png","language":"C#","readme":"# Lead Ads Webhook Sample on AWS\n\nThis 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.\n\nThis 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.\n\nBased on the [ASP.NET Core]( https://docs.microsoft.com/en-us/dotnet/api/?view=aspnetcore-3.1 ) Web API Serverless Application template.\n\nCreated by M. França - Solutions Architect (Solutions Engineering team LATAM).\n\n## TL;DR;\n\nGet this source code...\n```\ngit clone\n```\n\nInstall the AWS templates and tools for your VS Code installation...\n```\ndotnet new --install Amazon.Lambda.Templates\ndotnet tool install –g Amazon.Lambda.Tools\n```\n\nRetrieve the project's dependencies, compile everything, and run it locally...\n```\ndotnet restore\ndotnet run\n```\n\nValidate the SAM yaml file, then package everything, and finally deploy it to the AWS cloud...\n```\nsam validate --template-file aws_iaac.yaml\ndotnet lambda package --output-package .aws-sam\\build\\MyAWSomeLambda\\prjFBLeadAds.zip\nsam deploy --guided --template-file aws_iaac.yaml\n```\n\nMonitor the logs to find the id of your new lead...\n```\nsam logs -n MyAWSomeLambda --stack-name fra-fbleadads-back-stk --tail --region sa-east-1\n```\n\n## Setup\n\n### If you want to create it from scratch...\n\n```\ndotnet new serverless.AspNetCoreWebAPI --name prjFBLeadAds –o .\ndotnet restore\n```\n\n### Testing Locally (Running)\n\n```\ndotnet run\n```\n\n### Package \u0026 Deploy (on AWS)...\n\n```\ndotnet lambda package --output-package .aws-sam\\build\\MyAWSomeLambda\\prjFBLeadAds.zip\nsam deploy --guided --template-file aws_iaac.yaml\n```\n\n### Decomissioning\n\n```\naws cloudformation delete-stack --stack-name sam-app --region region\n```\n\n## References\n\n* [Facebook Webhooks]( https://developers.facebook.com/docs/graph-api/webhooks/getting-started )\n* [Retrieving Leads API]( https://developers.facebook.com/docs/marketing-api/guides/lead-ads/retrieving )\n* [AWS Command Line Interface]( https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html )\n* [AWS Serverless Application Model (SAM)]( https://aws.amazon.com/serverless/sam/ )\n* [Postman for testing API calls]( https://www.postman.com/ )\n\n## Additional Info\n\n### License\n\nThis source code is licensed under the MIT License. See the `LICENSE` file.\n\n### Contributions\n\nThis project is waiting for your contribution. See the `CONTRIBUTING.md` file.\n\n### Contact\n\nMarcelo França - www.linkedin.com/in/mafranca","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbsamples%2Flead-ads-webhook-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffbsamples%2Flead-ads-webhook-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbsamples%2Flead-ads-webhook-sample/lists"}