fmAccounting Link (Xero Edition) Now Supports FileMaker Cloud Server Scripts

We’re pleased to announce that fmAccounting Link (Xero Edition) now supports server side scripts when hosted with FileMaker Cloud. There were never any issues when using a FileMaker Cloud hosted version of fmAccounting Link (Xero Edition) when using the FileMaker Pro client application as all communication with the Xero API is handled by the plugin running under FileMaker Pro.

Using Perform Script on Server requires a new Linux version of the plug-in to run under FileMaker Cloud which runs on CentOS Linux. We’ve been testing a new version of the BaseElements plugin (v4.0.4) and have not encountered any issues when authenticating with the Xero API and uploading/downloading data between Xero and FileMaker.

If you’re using fmAccounting Link (Xero Edition) with FileMaker Cloud and would like to enable support for Perform Script on Server you just need to upload v4.0.4 of the BaseElements plugin (Linux Version for FileMaker Cloud). In the FileMaker Cloud Admin Console make sure you have first enabled Server Plug-ins and the Install Plug-In File Script Step under Configuration > System Configuration. When the plug-in has been installed successfully it should appear like this:

If you need help with installing the plug-in let us know and we can share a simple file that you can upload to your FileMaker Cloud Server and then perform a script to install the plug-in automatically.

Connecting FileMaker Pro to FileMaker Server with the FileMaker Data API

FileMaker Server 16 (and FileMaker Cloud 1.16.0) included a new trial feature called the FileMaker Data API (application programming interface), which allows web services or applications to access data in hosted FileMaker solutions without needing any FileMaker client software to be installed. This is similar to the current XML and PHP APIs which have been around for over 10 years, however the Data API is a REST (Representational State Transfer) API which means you don’t need to use any particular programming language to work with the Data API.

In their Product Roadmaps over the past couple of years FileMaker Inc. have indicated that they will be investing in the Data API in future releases of FileMaker platform. Whilst they have not included the XML and PHP APIs in their list of deprecated features their focus will be on the Data API which opens up the FileMaker platform to an almost unlimited number of external apps and services.

We’ve been working with REST APIs for many years – sending SMS messages, integrating with Accounting platforms and eCommerce platforms – so we were pleased to see FileMaker Server (and now FileMaker Cloud) include a REST API as this now opens up many possibilities for integration by external web services and applications, as they don’t need to know “FileMaker” in order to make requests with the Data API. If you’re familiar with making HTTP requests (GET, POST, PUT, DELETE) and working with JSON data formats then you will have no issues working with the FileMaker Data API.

As the FileMaker Data API is a trial feature – the trial expires on September 27, 2018 and the Data API will cease to operate – we normally wouldn’t recommend our clients use this feature in any live systems as it is likely to change and you will have to upgrade to the latest version of the FileMaker platform before the trial expires in order to keep using it (after making any necessary changes to ensure compatibility with the final release of the Data API). There is also the issue of licensing – the Data API is currently free to use in the trial period, but FileMaker plan to have a licensing model in place before the end of the trial. Without knowing what the final licensing model will be makes it hard for clients to commit to using the Data API at this stage.

During a recent project we had encountered a challenging issue that turns out was perfect for the Data API. This project has a FileMaker Server v16 hosted solution with a Custom Web Publishing/PHP interface. All users access the solution using a web browser – for security reasons installing FileMaker Pro was not an option. One requirement of the project was to allow printing of labels with barcodes and picking lists – we solved this by generating PDF files via the new support for generating PDF files on FileMaker Server as well as Excel files (see our blog post from last year on how we did this). We still ended up using a local FileMaker file to import the Excel file containing the data for the shipping labels and to create the barcodes.

This process was working smoothly but was more suitable for doing large bulk shipments and involved a number of steps that you normally wouldn’t have to perform in a purely FileMaker Pro interface:

  • users would first have to find the records via the web interface that they wished to generate labels for
  • they would then click a button to call the server side script to create the PDF or Excel file
  • they would then have to download this Excel or PDF file to their local machine
  • for PDF files they would simply open them and print as needed, and for the Excel files they would open the local FileMaker file and click a button to import the Excel file which then generated the labels and barcodes

As you can see there’s a number of steps involved, whereas with a pure FileMaker Pro interface there would typically be only 2 steps:

  • find the records to print
  • click a button to print the shipping labels or picking lists

The process was also the same regardless of whether you wished to print a single shipping label or 100 labels. We had been discussing ways to streamline and improve this process, knowing that we couldn’t connect to the solution using a live FileMaker Pro connection. We were leaning towards building a integration using either the XML or PHP APIs, or using a product like RESTfm when we realised that the Data API might be another option worth considering, knowing that it was a trial feature and would stop working in September but would be a better long term investment. Now that FileMaker Pro v16 supports cURL and JSON natively it started to make even more sense, even though using FileMaker Pro to integrate with FileMaker Server via the Data API doesn’t make too much sense at first.

We built a basic prototype in a few hours to authenticate and make simple requests to get single and bulk shipping labels and picking lists and were impressed by the speed of the responses, so decided to press ahead and incorporate this functionality into the existing local FileMaker solution that users were already using to import the Excel files and print labels and barcodes. We were further able to link the web interface with this local FileMaker file through the use of FMP URLs by adding buttons on the web interface that called scripts in the local FileMaker file and passed in parameters, so the updated process to print labels and packing lists is now down to 2 steps:

  • find the records to print
  • click a button to print the shipping labels or picking lists

If you’re thinking about using FileMaker Pro as a client for the FileMaker Data API here’s some tips and tricks we learnt along the way:

  • the FileMaker Data API Reference can be found on your FileMaker Server at this URL – https://localhost/fmi/rest/apidoc/ – and contains examples for the requests and responses you can expect when authenticating, working with records and performing finds. The FileMaker 16 Data API Guide is the other main reference to working with the Data API. I recommend having both of these resources open in separate tabs when working with the Data API for the first time
  • we recommend using tools like Postman when working with the Data API to learn how to structure your requests. You can convert your working requests to cURL using the Generate Code Snippets feature which you can then copy and paste into your FileMaker Insert From URL script step and format for use with FileMaker Pro. See our previous article about about using Postman environments with the REST API.
  • the Data API is not currently a complete replacement for the XML or PHP APIs. For example you cannot insert container data or run FileMaker scripts with the Data API, or retrieve metadata about your FileMaker solution such as layout schema. The Data API does not currently return data such as the number of found records like the getFoundSetCount() method does in the PHP API, so you need to use workarounds for these.
  • date formats appear to work in a similar way to the PHP API in that you need to specify them in MM/DD/YYYY format regardless of your date formats on your server or FileMaker solution. Dates are also returned in the same MM/DD/YYYY format (e.g. 11/30/2017 for November 30th, 2017).
  • when performing a find query the fields you are searching for don’t need to be on the layout you specified in your URL, but only fields on the specified layout are returned in the response.
  • when performing a find query that results in no records found the use of the –show-error cURL option determines whether the Insert From URL script step returns an error (1631) or not. This is documented in the Supported cURL options page help page under the Handling errors heading.
  • one issue that caused us grief is an apparent bug with the use of the JSONSetElement function with spaces when used in a particular way the the cURL options. We have now standardised on specifying the JSON for each Data API request using the –data @$data syntax instead of the alternative methods
  • to help with debugging we recommend using the –trace and –dump-header options with every request

The final cURL options generally look like this for a typical request (assuming you have already authenticated and stored the access token somewhere):

"--request POST" & 
" --header " & Quote( "Content-type" & ": " & "application/json" ) & 
" --header " & Quote( "FM-data-token" & ": " & $$restAPIAccessToken ) & 
" --data @$json" & 
" --trace $$cURLTrace" & 
" --dump-header $responseHeaders"

Using FileMaker Pro as a client for the FileMaker Data API has us thinking about new ways we can leverage the Data API from an offline FileMaker Pro or FileMaker Go client, such as syncing records when using FileMaker Go on an iPhone or iPad and removing the overhead of having to have a live connection to your FileMaker Server. The Data API is perfect for uploading or downloading small changes from an offline file and once the shipping version of the Data API is available in the next version of the FileMaker platform (and the licensing model revealed) we expect to see more widespread use of the Data API, particularly for offline files running under FileMaker Go.

 

Using Postman Environments and Tests with the FileMaker Data API

One of the new features of FileMaker Server 16 and FileMaker Cloud 1.16.0 is the FileMaker Data API – currently in trial mode which expires on September 27, 2018. The FileMaker Data API is an application programming interface (API) that allows web services to access data in hosted FileMaker solutions and conforms to Representational State Transfer (REST) architecture, making the FileMaker Data API a REST API.

You can use the Data API to integrate your FileMaker solutions with other applications and services – REST APIs are the current standard for integration and the Data API will be the replacement for the current XML and PHP APIs.

Your web service or application calls the FileMaker Data API to obtain an authentication token for access to a hosted solution, then uses that token in subsequent calls to create records, update records, delete records, and perform find requests.The FileMaker Data API returns data in JavaScript Object Notation (JSON), another standard that is used with REST APIs for data formatting (and is also supported by FileMaker Pro v16).

A great tool to use when testing REST calls with the Data API is Postman, a free app for macOS, Windows and Linux (paid versions are also available). Postman allows you to make requests (GET, POST, PUT etc) to a REST API like the FileMaker Data API and inspect the response, including the headers. You can quickly make changes to the requests and headers that you send and compare the results – when working with REST APIs a tool like Postman is indispensable.

As mentioned above the FileMaker Data API requires you to obtain an authentication token when first accessing a FileMaker solution – the access token is valid until you log out of a solution or for 15 minutes after the last call that specified the token. While the token is valid, each call that specifies the token resets the session timeout counter to zero. To save you from having to manually copy and paste your token with each new request you can use some features of Postman to save your from having to manually update any variables in your requests manually, including the Data API access token.

Postman lets you setup multiple “environments” that can contain multiple variables fore each environment, such as the host address URL. For example you might have a development environment and a production environment, each with their own host address and other variables. In Postman I would simply have a POST request URL like this:

https://{{server}}/fmi/rest/api/auth/Tasks

and in each Postman environment I would specify the value for the {{server}} variable. When you make your request by hitting the Send button in Postman it will insert the appropriate value for each variable you’ve specified. You can read all about setting up Postman environments and variables in the Postman docs.

As you can’t specify the Data API access token in advance you can use another great feature of Postman to dynamically create the token variable which is then used in subsequent API requests. Your initial request to authenticate/login will look like this:

{ "user":"admin", "password":"admin", "layout":"Tasks" }

and if successful the response will look like this:

{ "errorCode": "0", "layout": "Tasks", "token": "fdde29fa175eb1cc8347512ca327b191619fc32ed65efaab26d8" }

Using the Tests feature when making a Postman request you can execute some JavaScript code after the request is sent to dynamically create a token variable that you can use with your subsequent API calls without having to copy and paste the token each time. Here’s a screenshot of how you would set this up in Postman for the Data API authentication request:

The JavaScript code you can copy/paste is:

var data = JSON.parse(responseBody);
postman.setEnvironmentVariable("token", data.token)

Using Postman environments and Tests to update the token variable makes working with the FileMaker Data API much easier and should save you a lot of time.

FileMaker Cloud Joins the FileMaker 16 Platform

FileMaker, Inc. today announced availability of the latest version of FileMaker Cloud, its cloud platform for managing and running custom apps that runs on the Amazon Web Services Cloud. With this release (1.16.0.55), FileMaker Cloud joins the FileMaker 16 Platform and it is available in the US, Canada, Europe, Japan and Australia.

This release of FileMaker Cloud requires FileMaker 16.0 clients at a minimum – if you’re using FileMaker v15 clients you will need to upgrade to v16 in order to access hosted solutions on FileMaker Cloud 1.16.0.55. You can read the full release notes here.

The new release includes a number of integration, security and development features:

  • FileMaker Data API trial: Use FileMaker data in other popular apps and services with the REST-based FileMaker Data API in FileMaker Cloud during the trial period.
  • Tableau Web Data Connector for FileMaker: Better visualize FileMaker data with the Tableau Web Data Connector for FileMaker. The connector uses the FileMaker Data API trial to provide integration with Tableau Desktop.
  • FileMaker Admin API trial: Help manage and administer custom apps with the REST-based FileMaker Admin API trial in FileMaker Cloud. Create messages and script schedules, open and close apps, and more.
  • OAuth 2.0 support for accounts: Simplify credential management with OAuth 2.0 using third-party authentication providers. Use existing Amazon, Google or Microsoft Azure account credentials to log in to FileMaker custom apps.
  • PDF support: Generate PDFs of layouts and data from FileMaker WebDirect. Save and print PDFs of invoices, labels, badges and more, just like with FileMaker Pro.

For more information on the differences between FileMaker Cloud and FileMaker Server check out our previous article on FileMaker Cloud as well as FileMaker Inc’s comparison between the two products. This release of FileMaker Cloud brings the ability to schedule scripts via the new FileMaker Admin API trial which was one of the missing gaps when compared to FileMaker Server. FileMaker Cloud does not support Custom Web Publishing with PHP and XML and FileMaker Inc. have stated that this will not be supported by FileMaker Cloud in the future – the FileMaker Data API will be the focus as far as API integrations are concerned so developers should focus their efforts here.

fmSMS and FileMaker Cloud

FileMaker Cloud, FileMaker Inc’s cloud-based platform for managing and running custom apps, was officially launched one year ago this month. FileMaker Cloud gives you the simplicity and performance of the FileMaker Platform without spending time and resources deploying and maintaining a server

FileMaker Cloud runs on the Amazon Web Services Cloud (AWS) and was originally only available for customers in the United States and Canada (AWS Regions of Oregon and N. Virginia). This was extended to Europe, the Middle East and Africa in March 2017 (AWS regions of Ireland and Frankfurt) and Japan, Canada and Australia in July 2017 (AWS regions of Sydney, Canada and Tokyo).

There are a number of important differences between FileMaker Cloud and the traditional version of FileMaker Server for Mac/Windows – it’s worth remembering that FileMaker Cloud is not FileMaker Server as not all FileMaker Server features are available in FileMaker Cloud. FileMaker have a comparison between FileMaker Server and FileMaker Cloud that outlines the differences in various categories – some of the features of FileMaker Server not currently available in FileMaker Cloud that have implications for fmSMS include:

  • Custom Web Publishing with PHP and XML
  • Scheduled Scripts in the FileMaker Server Admin Console

There are no issues using a FileMaker Cloud hosted version of fmSMS and the FileMaker Pro client application to send messages as all communication with the SMS Gateway when sending messages is handled by FileMaker Pro. We’re currently working on support for using Perform Script on Server – this requires a new Linux version of the plug-in to run under FileMaker Cloud which runs on CentOS Linux.

We’re currently testing this and hope to have an update shortly. Please note that server side schedule scripts are not currently supported on FileMaker Cloud – you will have to use Perform Script on Server for any server side script operations. Perform Script on Server is used by FileMaker Go and FileMaker WebDirect clients when accessing a hosted version of FileMaker Server to send messages. Now that FileMaker Pro v16 includes native support for JSON and cURL we will be able to use native functions to communicate with the SMS Gateways without requiring a FileMaker plug-in, so FileMaker Go and FileMaker WebDirect clients will be able to send messages directly without having to perform server side scripts that required a plug-in to be installed on FileMaker Server.

For receiving incoming messages/replies most of the SMS Gateways push incoming messages to a PHP file running on your FileMaker Server/Web Server. This uses the Custom Web Publishing with PHP feature of FileMaker Server – FileMaker Cloud does not support Custom Web Publishing so you will not be able to use the FileMaker Cloud to receive incoming messages using the supplied PHP pages. Some SMS Gateways do allow you to ‘poll’ periodically for new messages and download these from the SMS Gateway – see our Getting Started guide for further details.

We’re also investigating using the new FileMaker Data API to receive incoming messages – this is currently offered as a trial version with FileMaker Server v16 and is not currently available with FileMaker Cloud, so we will most likely wait until FileMaker Inc. release the shipping version and have finalised the licensing model and included this with FileMaker Cloud.

fmAccounting Link (Xero Edition) Update August 2017

We’ve been busy over the last couple of months working on some updates to fmAccounting Link (Xero Edition) that fill in some missing gaps with the examples that we include in the fmAccounting Link (Xero Edition) file. For example we’ve always had examples for downloading:

  • Chart of Accounts
  • Tax Rates

from Xero into FileMaker, but some customers have asked for the ability to create and update these from FileMaker to Xero. We’re pleased to report that our latest update – v1.932 – now includes examples for creating Account Codes and Tax Rates in FileMaker and pushing these to Xero. You would typically apply some kind of access privileges around these features so that only authorised accounts users can perform these functions, but the functionality for this is now included in the core fmAccounting Link (Xero Edition) files.

We’ve also updated the Bank Transactions endpoint examples to support creating and updating Bank Transactions (spend or receive money) in FileMaker and pushing these to Xero. This update also includes some minor bug fixes – you can view all the changes in the version history notes.

Last month Andrew Duncan from Databuzz attended #XD17 – the Xero Developer Roadshow – in Melbourne, Australia. There were some great presentations on upcoming features for the Xero API as well as some cool demos showcasing some cutting edge Amazon Web Services integrations with Xero. Xero have also announced that Webhooks are coming to the Xero API, starting with the Contacts endpoint first then followed by Invoices (the two most popular Xero API endpoints). Databuzz have been invited into the closed beta of this and we’ve started work on a PHP solution using the FileMaker PHP API that will accept the incoming Xero Webhooks notifications and trigger an update in the fmAccounting Link (Xero Edition) file. We will post an article with further details about this when Webhooks becomes publicly available.

Xero have also just announced support for JSON when uploading data to Xero via the API – they have previously only supported JSON for downloads (GET requests). Now that FileMaker Pro v16 supports JSON natively this will allow us to add native support for uploading and downloading data between FileMaker and the Xero API.

We also get a number of questions about Invoice Numbers when pushing Invoices from FileMaker to Xero, so we’ve updated our list of Frequently Asked Questions with some details about the options you can use when pushing an Invoice from FileMaker to Xero and whether to allow Xero to generate an Invoice Number to have FileMaker push the Invoice Number across to Xero to use. We’ve also updated our FAQ to include a note about FileMaker Cloud support.

FileMaker Cloud Now Available in Australia and Japan

FileMaker Inc. today announced that FileMaker Cloud, their cloud-based platform for managing and running custom apps, now supports the Japan and Australia Amazon Web Services (AWS) regions. With FileMaker Cloud you don’t have to spend time and resources deploying and maintaining a server – there are no up-front costs and you can be up and running in around 20 minutes.

FileMaker Cloud now supports 7 AWS regions including:

  • Sydney
  • Tokyo
  • Canada
  • US West
  • US East
  • Ireland
  • Frankfurt

Today’s update also includes the ability to renew the 90-day trial Comodo SSL certificates through the FileMaker Store for 1, 2 and 3-year terms, using the initial host name and the filemaker-cloud.com domain. We recently wrote about our experiences with FileMaker Cloud and some differences between FileMaker Cloud and the traditional FileMaker Server product that you should be aware of.

 

FileMaker Cloud Notes

FileMaker Cloud, FileMaker Inc’s cloud-based platform for managing and running custom apps, was officially launched in September, 2016. FileMaker Cloud gives you the the simplicity and performance of the FileMaker Platform without spending time and resources deploying and maintaining a server

FileMaker Cloud runs on the Amazon Web Services Cloud (AWS) and was originally only available for customers in the United States and Canada (AWS Regions of Oregon and N. Virginia). This was extended to Europe, the Middle East and Africa in March 2017 (AWS regions of Ireland and Frankfurt). According to FileMaker Inc’s product roadmap the next AWS Regions to be supported will be Japan, Australia, and Montreal.

There are a number of important differences between FileMaker Cloud and the traditional version of FileMaker Server for Mac/Windows – it’s worth remembering that FileMaker Cloud is not FileMaker Server as not all FileMaker Server features are available in FileMaker Cloud. FileMaker have a comparison between FileMaker Server and FileMaker Cloud that outlines the differences in various categories – some of the features of FileMaker Server not currently available in FileMaker Cloud include:

  • Custom Web Publishing with PHP and XML
  • Scheduled Scripts in the FileMaker Server Admin Console
  • External authentication via Active Directory/Open Directory

It’s also worth noting that FileMaker Cloud’s support for certain features may lag behind what is offered by FileMaker Server. For example the ESS Adapter that was introduced with the FileMaker 15 platform providing External SQL Data Source support for PostgreSQL, IBM DB2 and IBM iSeries is not currently supported in FileMaker Cloud, and some of the recent features of FileMaker Server v16 such as PDF support and the Data API are not currently supported in FileMaker Cloud. The FileMaker Server v16 features are currently “in development” according to the product roadmap so we can expect to see this released at some stage in the future.

If you use plug-ins with FileMaker Server (e.g. when called via the Perform Script on Server script step) you will need to check with the plug-in developer as they will need to compile a Linux version of the plug-in. You will also need to use the Install Plug-In File script step to install the plug-in from a container field in a file hosted on your FileMaker Cloud server.

Setting up a FileMaker Cloud instance is very quick – around 20 minutes or less in our tests so far. The FileMaker Cloud Getting Started Guide has all the steps required, including the AWS requirements, to get you up and running. As you don’t need to setup a physical server or operating system (FileMaker Cloud runs on CentOS Linux 7.2) everything is managed through the AWS and FileMaker Cloud consoles. You upload files to FileMaker Cloud the same way you do for FileMaker Server – using the FileMaker Pro/Pro Advanced client. There are some important differences with FileMaker Cloud, including the requirement for all files to be encrypted and that files that have the default account name of “Admin” with no password will be blocked from being uploaded until a valid password is configured for that account – this FileMaker Knowledge Base article has more details.

For FileMaker Developers there are some important differences in the results of certain FileMaker functions:

Get (HostApplicationVersion) returns Cloud Server 1.15.2.23 (the number corresponds to the FileMaker Cloud Version number from the FileMaker Cloud Admin Console)

Get (SystemPlatform) returns 5

Get (SystemVersion) returns 7.2.1511 (this is the version of CentOS)

Get (TemporaryPath) returns /FileMakerData/tmp/S177/

Get (DesktopPath) returns /home/fmserver/Desktop/

Get (DocumentsPath) /opt/FileMaker/FileMaker Server/Data/Documents/

Get (CurrentHostTimestamp) always returns timestamps in the UTC time zone. If you want to use the local time zone, you must include the calculation (the difference between UTC and your time zone) in your FileMaker Pro scripts/calculations. There’s a number of ways to do this such as this custom function.

FileMaker Inc have a number of online resources to help you with your FileMaker Cloud installation:

If you have any questions please leave a comment below or get in touch.