Welcome to the "Get Facebook Page Reviews Using API" template! This template is designed to help you fetch reviews from a Facebook page using the Facebook Graph API. It leverages FastAPI to create an endpoint that interacts with the Facebook API, allowing you to retrieve page reviews easily. Before you can use this template, you'll need a Facebook access token with the `pages_read_user_content` permission scope.
To begin using this template, simply click on the "Start with this Template" button. This will pre-populate the code in the Lazy Builder interface, so you won't need to copy, paste, or delete any code manually.
Before you can test the app, you'll need to set up an environment secret for the Facebook access token. Here's how to do it:
Once you have set up your environment secret, press the "Test" button. This will begin the deployment of the app and launch the Lazy CLI.
After pressing the "Test" button, if the app requires any user input, the Lazy App's CLI interface will prompt you to provide it. For this template, you will be asked to enter the Facebook page ID for which you want to fetch reviews.
After deployment, Lazy will provide you with a dedicated server link to use the API. Additionally, since this template uses FastAPI, you will also be provided with a link to the FastAPI documentation at `/docs` where you can test the API endpoints directly.
If you wish to integrate this app into another service or frontend, you can use the server link provided by Lazy. For example, you can make POST requests to the `/facebook_reviews` endpoint with the page ID to fetch reviews. Here's a sample request you might use:
POST /facebook_reviews HTTP/1.1
Host: [Your Lazy Server Link]
Content-Type: application/json
{
"page_id": "your_facebook_page_id_here"
}
And here's a sample response you might receive:
{
"reviews": {
"data": [
{
"created_time": "2021-01-01T00:00:00+0000",
"recommendation_type": "positive",
"review_text": "Great service and support!"
},
// ... more reviews ...
]
}
}
Remember, you can use the `/docs` endpoint to interact with the API and see the full specifications of the requests and responses.
That's it! You're now ready to fetch Facebook page reviews using the Lazy platform. Happy building!