How to Connect to FileMaker REST API

Document created by steve_skripek082158 Employee on Sep 19, 2017Last modified by Adam Arrowsmith on Sep 26, 2017
Version 3Show Document
  • View in full screen mode

This article describes how to connect to the FileMaker REST API using the HTTP Client Connector.

 

 Get the example process used below from the Process Library here.

 

 

 

Use Case

In early 2017, FileMaker released a new REST API for integrating with the FileMaker application. REST connections to the FileMaker API require the use of a token. This article describes how to configure the HTTP Client Connector within an AtomSphere process to obtain a token by sending a request to the FileMaker API. This token can then be referenced in subsequent calls to interact with FileMaker data.

 

Implementation

 

FileMaker Setup

To use the FileMaker API, you will need to enable access to the API per the FileMaker documentation located here: FileMaker 16 Data API Guide.  You will also need to define a FileMaker user account for obtaining the token.

 

AtomSphere Setup

 

Get Token

Within AtomSphere:

  1. Setup an HTTP Connector, with action of "Get" and point the connector to your FileMaker data location e.g. https://data.filemakerco.org
  2. Create an HTTP Operation and use the resource location of "fmi/rest/api/auth/{location}"
  3. Set the HTTP Method to POST
  4. Set the Content Type to "application/JSON"

 

Create a simple JSON profile in a Message shape with the following contents:

 

'{
"user":"{username}",
"password":"{password}",
"layout":"{layoutlocation}"
}'

 

*Note that when you insert JSON to a Message shape in AtomSphere, it needs to be escaped using an apostrophe both before and after the JSON.

 

A successful request to the auth method will give a response matching the following:

 

{
"token": "{token-hex-value}",
"layout": "{layoutlocation}",
"errorCode": "0",
"result": "OK"
}

 

Subsequent Requests

Then manually create a simple JSON Profile that matches this response data to be able to parse the "token" field.

 

For subsequent HTTP Client Connector calls to FileMaker, in the HTTP Client Operation component, configure a Request Header named "FM-Data-token" (for example; name is arbitrary). This request header should be set using a Dynamic Document Property before subsequent Connector shapes. For POST-type requests to query, create, or update records, see How to Build a POST Request for a REST Endpoint with Replacement Variables. This will provide the authorization needed to connect to the FileMaker API.

 

For more information on the FileMaker including additional calls, see FileMaker 16 Data API Guide.

Attachments

    Outcomes