Now that we’ve got our interface file in place it’s time to start interacting with it using the FileMaker Data API. Initially we’re going to use Postman, an API development and testing tool to try out the various options that are available to us. If you don’t have Postman installed, grab it form their downloads page (which has both Windows and Mac versions).
- Launch Postman and dismiss any ‘welcome’ screens to get to the main interface
- From the menu select File > Import
- Open the session resources folder, locate the Postman folder and drag and drop the two configuration files (the ones not called readme.txt) onto the import dialog. These two files have different purposes
FileMakerDataAPIDemo.postman_collection.json
is a pre-configured set of API calls which we can then use in Postman to make calls to the Data API. This is a ‘shortcut’ to save you having to set up the queries yourself for things like authentication, creating, fetching and deleting records etc.FileMakerDataAPIDemo.postman_environment.json
contains a number of variables that are used to configure the calls made in the collection. It holds things like the server address, database name, authentication token etc and saves having to include these things manually in each query in the collection.
- We now need to configure the environment that we just imported
- In the top right corner of Postman select the dropdown which by default will say ‘No environment’ and switch to the
FileMaker Data API demo
environment. - Click the
eye
icon to open the configuration of the environment - In the
FileMaker Data API demo
section at the top update theCurrent Value
for thedatabase
variable to the name of the interface file you just created – when you hover over the current value a ‘pencil’ icon will appear to allow it to be edited. The top two variables,recordId
andFMAPIToken
will be updated as we perform various requests to the FileMaker Data API.
- In the top right corner of Postman select the dropdown which by default will say ‘No environment’ and switch to the
- Back to the main Postman interface
- Switch to Collections
- Expand the
FileMaker Data API demo
collection - Click on the
Authenticate
task - Select the
Authorization
tab - Update the
Username
andPassword
to match theFull Access
account you created in activity one. - Click
Send
to perform the query
- Explore each of the other items in the collection and monitor the impact they have in FileMaker.