Leveraging the FileMaker Admin API in Client Solutions
When the FileMaker Admin API was first released, initially as a trial with FileMaker Server 17 and then officially with FileMaker Server 18, my curiosity was piqued and I wondered if this was something I would be able us with client solutions in the future. We already had the web Admin Console interface as well as the Command Line Interface (CLI) for administering your FileMaker Server, but these were typically used by FileMaker Server administrators and were generally not tools you would grant end users access to.
With the release of the Admin API we now had a tool that provided the ability to perform server administration functions without requiring access to the server itself. Just as the Data API provides a REST API to access to the data in your hosted FileMaker solutions the Admin API provides a REST API for managing and administering FileMaker Server.
Since the release of FileMaker Server 18 in 2019 I’ve used the Admin API to perform a number of admin related functions and allow users of hosted solutions to perform functions that previously would have required giving access to the Admin Console. Here’s a summary of how I’ve used the Admin API in my end user solutions:
Listing Connected Clients
I’ve had a number of clients that needed to generate a list of users that were currently connected – for example to compare against rostering systems to identify users that were rostered on but not actually logged on to the FileMaker solution in question. The Admin API has a List Clients
endpoint which returns a list of the connected clients. You can also use the Admin API to send a message to a connected client (similar to sending a message in the Admin Console).
Backup FileMaker Server Schedules
I have a number of clients that have over 50 complex server schedules that perform a number of maintenance tasks and bulk notifications. Upgrading to a new version of FileMaker Server always involves some anxiety that the schedules will be restored successfully when I import them using the Admin Console. Using the Admin API I can also make a separate backup of these using the List Schedules
endpoint and restore these if necessary.
Perform a FileMaker Server Schedule
FileMaker Server Schedules can run a number of automation tasks, including:
- FileMaker scripts defined in hosted databases
- system script files
- database integrity verification
Often it makes sense to schedule these to run at a regular schedule (e.g. every 2 hours or at 11pm nightly). There are often times it doesn’t make sense to have a server schedule running on a recurring interval as it will only be required on an ad hoc basis. Using the Admin API you can now perform a schedule on demand when required – I’ve used this with a number of clients to perform complicated schedules that perform multiple tasks on demand instead of having these running needlessly every 15 minutes. I’ve setup FileMaker Pro scripts that give users the ability to perform one of these complicated server schedules as required without having to give them access to the Admin Console.
You can learn more about the FileMaker Admin API at the Claris FileMaker Admin API Guide. You can get detailed information about the API calls in the Admin API Reference. You can view the reference in a web browser on the primary machine at the following URL:
https://localhost/fmi/admin/apidoc
You can view the reference on a remote machine at the following URL:
https://host/fmi/admin/apidoc
If you’re planning to incorporate Admin API calls in your FileMaker solutions I highly recommend downloading the free FM-Admin API Tool that Mike Duncan from Soliant Consulting has generously made available. It includes examples for working with all the Admin API endpoints and can save you many hours getting familiar with making Admin API requests.
If you’re using the Admin API with your client solutions in interesting ways please comment below and share your experiences.
Leave a Reply
Want to join the discussion?Feel free to contribute!