Harnessing the Power of Web Services in FileMaker with API Connections
If you’re a FileMaker developer, you already love the process of building custom apps to automate your business processes. But in today's connected world, integrating with web services has become an essential add-on for business apps. And you may or may not know that FileMaker Pro makes it simple to exchange data with external web APIs right from your database solutions. By leveraging web API connections, FileMaker developers can add the capability to draw down a myriad of useful datapoints with little or no effort from the user. Examples of this include retrieving currency exchange rates, travel information, geolocation data, third party email and SMS services and even interrogating generative AI services such as ChatGPT. If you’ve never looked into this before, read on!
What Are Web APIs and How Do They Work?
Application Programming Interfaces (APIs) are simply code modules that allow different software applications to communicate with each other. On the web, APIs use standard web protocols such as HTTP and JSON. Popular web services including Twitter, Google Maps and MailChimp all offer web APIs that developers can connect to from their own apps.
For example, Twitter's API allows users to retrieve tweets, post new tweets, follow other users and more. Google's Maps API enables the embedding of interactive maps. MailChimp allows third party apps to authenticate and then manage subscriber lists and email campaigns.
Connecting FileMaker to Web Services via APIs
FileMaker introduced native connectivity to web APIs through the Insert From URL script step way back in version 12.0. It’s this that allows FileMaker developers to directly call third-party web APIs from scripts and workflows.
The process involves:
- Locating the API documentation for the desired web service. This specifies the API endpoints and how to structure API requests. Every API is custom-built by its developers so you can’t assume that any two APIs are structured in exactly the same way.
- Configuring authentication if required by the API. Non-commercial sites providing publicly-available information may not require authentication. For example, https://restcountries.com provides country-based information such as population, language and capital city and https://randomuser.me/api/ is a useful site for generating dummy persona records with datapoints such as name, sex, address, email and a photograph. Many web services and certainly the commercial ones of course do require authentication and will typically use OAuth or API keys.
- Writing a script in FileMaker that performs an HTTP GET or POST request to the API endpoint URL, passing any required parameters.
- Parsing the JSON response data returned by the API into FileMaker variables or fields.
- Displaying or using this acquired data within the FileMaker app as needed.
Key Benefits of Integrating Web APIs into FileMaker
There are many, including:
- Accessing External Data Sources - FileMaker can now securely connect to remote structured data sources beyond the native database. This provides broader data connectivity.
- Expanding Functionality - By tapping into third-party web services, FileMaker developers can add prebuilt capabilities and avoid building something new from scratch.
- Creating Robust Experiences - Connecting with APIs allows the addition of elegant interfaces such as embedded interactive maps, charts, calendars and many other widgets that deliver useful information on the spot.
- Automate Processes - Workflows can be triggered based on events from web APIs to enable smoother automated operations and notifications. For example, a web-based sales or enquiry process could be more or less entirely automated with judicious use of APIs and webhooks that trigger one event after another. Develop Once, Reuse Everywhere - API integrations created for one FileMaker app can be stored in custom functions or other reuseable code, for whenever they are next needed across other solutions, avoiding redundant work.
Real-World Examples
Here are some examples of how FileMaker developers might leverage web APIs:
- Integrate shipping APIs from such as FedEx or UPS to add package tracking and label printing.
- Use multi-language translation APIs such as the Google Translate API for DeepL to translate on the spot.
- Pull in maps, geocoding and routes from Google or Mapbox APIs for location-based apps.
- Connect Instagram's API to display user profiles and galleries.
- Use Twilio's API to add SMS and phone call capabilities and email sending via SendGrid.
- Retrieve product data from the Amazon API to sync inventory catalogues.
Getting Started
The ability to exchange data with modern web services opens up many valuable possibilities within FileMaker. Whether it's centralising data, offloading processing, enhancing experiences, or enabling new functionality, web APIs are a great way to incorporate external capabilities. You can start very easily with simple services such as the authentication-free examples above and then build from there. As more services offer web APIs, integration should be a standard part of the FileMaker developer toolbox.
Related Training Courses
FileMaker Pro
Useful Resources
- The Insert From URL script step The official Claris FileMaker Pro Help article
- UK Bank Holidays Scrape British bank holidays using this site
- Genderize.io Predict a person’s gender based on their name
- Apipheny.io Well known compendium of free APIs to practice with
- Google Translate Multiple language translations
- Exchangeratesapi.io Straightforward JSON API for exchange rate data - 100 free requests per month