Having your own calendar inside of FileMaker is a great way for you and your coworkers to keep track of upcoming appointments. However, building your own calendar in FileMaker is a very tedious task. Why reinvent the wheel when there are already apps out there that you can integrate with? I will show you how to connect your FileMaker solution with Google Calendar to take advantage of this powerful calendar and all of its features.
Creating a Free Developer Account
The first step of this integration is to create a project in the Google Developers Console. Once you have created the project, you will then need to enable the Calendar API. This will take you to a setup process where the API will be managed. We will be using HTTP requests, so you will want to mark that the API will be accessed via a web browser client and that you will be accessing user data. You will also need to set the redirect URI to https://google.com or any valid website. This is only used as a landing page for authentication and does not need to be anything special. Once the Client ID has been created, copy the Client ID and Client Secret into your solution. Keep your client secret hidden from the world as the combination of the Client ID and Client Secret will be used to authorize your solution to make changes to the end user’s calendar.
Authenticating with Google
Once you have your API information, you will need authenticate your solution with the Google Calendar API. FileMaker can’t set headers natively, and later on we will need to use a HTTP PUT command, so a plugin is needed in order to make any requests to the Google Calendar API. I suggest using the BaseElements Plugin as it is a free and powerful plugin that can handle all of our HTTP request needs. For any questions regarding how requests should be built, please reference the Google Calendar API Documentation. To authenticate your solution, place the user into a web viewer at the API authentication screen. This will prompt the user to login with their own account and allow your solution to make changes to their calendar.
Once they have agreed, they will be sent to the address specified in your redirect URI. In the address, there will be url encoded parameters, one of which will be the authentication code. Finally, you will use the code provided, along with your client ID and secret to get your access token which will be used to make any API requests.
Making Requests and Parsing the Response
Many of the Google Calendar API requests require additional parameters outside of the URL encoded parameters. The Insert Event request, for example, is a POST request which requires additional fields like the start and end date, event title, and many other optional settings for the event. These extra fields will need to be JSON encoded text, passed as the parameter in the BaseElements function BE_HTTP_POST ( url ; parameters ).
Set Variable [ BE_HTTP_POST ( "https://www.googleapis.com/calendar/v3/calendars/primary/events?access_token=[Your Access Token] ; $data ) ]
Once a successful request has been made, a JSON encoded response will returned. You will then be able to use the function BE_JSONPath( ) to pull any information out of the response that you wish.
For example, you can get the newly created event ID by using the following set of functions:
Set Variable [ BE_JSONPath ( $jsonResponse ; "$.id" ) ]
Google Calendar can be fully integrated with your FileMaker solution! You can create, update, delete, or move events to different calendars all from within FileMaker. Save time and money taking advantage of all the features built into the calendar you already use. Feel free to contact us if you need further assistance or to discuss getting your company calendars into FileMaker.
Did you know we are an authorized reseller for FileMaker Licensing?
Contact us to discuss upgrading your FileMaker software.
Customized Around You. Every organization is unique and, in turn, needs a database system to support your unique processes. However, organizations oftentimes use off-the-shelf software that forces you into adjusting your workflow to fit the program's one-size-fits-all system design. Other times, businesses use a mix of spreadsheets, email, paper files, and accounting software that eventually leads to a lack of transparency and redundancies that becomes difficult to manage as an organization grows.
What we do differently is we design and create your system around you. You will emerge with a faster, more efficient, scalable database that runs smoothly and provides a platform for future business process improvement. Your database solution will become a value-adding asset that is an integral part of your organization.Website: www.dbservices.com