Welcome to the Lazy template guide for retrieving events from a Google Calendar on a specific date. This template is designed to help you build an application that interacts with the Google Calendar API to fetch and display events for a given date. It includes endpoints to get events in a list format and to download them as a JSON file. Additionally, it provides a simple HTML frontend to interact with these endpoints.
To begin using this template, click on "Start with this Template" in the Lazy builder interface. This will pre-populate the code in the Lazy Builder, so you won't need to copy or paste any code manually.
Before you can use the application, you need to set up an environment secret for the Google Calendar API key:
GOOGLE_CALENDAR_API_KEY
and paste your copied API key as the value.Once you have set up the environment secret, press the "Test" button. This will deploy your application and launch the Lazy CLI. The CLI will not prompt for any user input as all necessary information is provided through the API endpoints.
After pressing the "Test" button, Lazy will provide you with a dedicated server link to access your application. If you're using FastAPI, Lazy will also provide a link to the API documentation.
To interact with the app:
If you wish to integrate this application into another service or frontend, you can use the provided API endpoints. Here's an example of how to make a request to the API:
GET /events/{calendar_id}/{date}
Replace {calendar_id}
with the ID of the Google Calendar and {date}
with the date you want to fetch events for (in YYYY-MM-DD format).
A sample response from the API might look like this:
[
{
"start": {"dateTime": "2023-04-01T10:00:00Z"},
"end": {"dateTime": "2023-04-01T11:00:00Z"},
"summary": "Event Title",
"description": "Event Description"
},
// ... more events
]
Use the server link provided by Lazy to make requests to your deployed application. If you need to integrate these endpoints into a frontend application, you can make AJAX calls to these endpoints and process the response as needed.