Software tips, techniques, and news.

By Eric Church  Posted on  May 9th, 2017  in  Free Downloads, Web, FileMaker

FileMaker cURL Options

One of the most important and wide-reaching updates in FileMaker 16 is the ability to set cURL options in the Insert from URL script step. This allows FileMaker to natively integrate with innumerable services across the web, including Google Calendar, Google Maps, Microsoft SharePoint, and many other services.

What is cURL?

cURL stands for ‘Client URL Request Library,’ or just ‘Client for URLs,’ and it’s a way to interact with data across devices around the world with many different protocols, such as HTTP, FTP, etc. FileMaker 16 allows users to specify headers, set request types, receive response codes, among many other things.

HTTP response codes are important because they let you know whether your operation ran correctly or not. If you get a code back that starts with 2, you know it succeeded (e.g. 200). Any other code, it failed (e.g. 404). Checking the response code is a necessity in REST APIs.

FileMaker cURL in Action

Using the Integrating FileMaker with RESTful APIs file, we’ve updated it to now use Insert from URL with cURL options instead of the BaseElements plugin. We can now natively perform all of the HTTP CRUD functions AND get responses and set HTTP headers, which wasn’t possible before FileMaker 16. Because plugins aren't necessary, that also means that users on FileMaker Go, WebDirect, and even Custom Web Publishing have the same power the desktop app is capable of.

So what does it look like?

FileMaker 16 updated the Insert from URL script step in a couple of different ways. First, they added cURL options that you can specify as a calculation:

FileMaker Insert from URL Options

Second, they opened up the Target to be either a field or a variable, instead of just a field:

FileMaker Insert URL Target

In our GIF above, our cURL options calc looked like this:

filemaker curl options calc

Let's break it down:

  • The "-X" means that we have a request. Note that cURL shortcuts are case-sensitive, so "-X" and "-x," for example, don't mean the same thing.
  • "POST" says what kind of HTTP request it is (create).
  • The "-D" means that we want a header dump.
  • The "$httpResponseHeaders" variable is where we want the headers dumped to. "--header" means we want to specify a request header.
  • "\"Content-type: application/x-www-form-urlencoded\""" says we we're sending the header as a string.

filemaker insert from url script step
The full Insert from URL script step with data.

After running the script, the HTTP status header we got back was:

filemaker curl http response headers

That's a lot of text, but the most important part is the first line: code 201 lets us know the record was created. Huzzah!

While this expands the functionality of FileMaker immensely, in taking a look at FileMaker’s supported cURL options, it's important to note that not all cURL options are available. However, given the importance of cURL and the power it brings, it's a great start.

Conclusion

FileMaker and cURL go hand-in-hand with allowing FileMaker solutions to natively interact with other platforms and services in ways that greatly improve its depth and scope. It gives all users, whether on desktop, mobile, Custom Web Publishing, or WebDirect, the ability to interact with external services through FileMaker without the need for plugins.

Download
Download the FileMaker CURL Options File
Please complete the form below to download your FREE FileMaker file.
FileMaker Experience *
Terms of Use *
OPT-IN: I agree that I am downloading a completely free FileMaker application file with no strings attached. This file is unlocked, and I may use it for my business or organization as I see fit. Because I am downloading a free file, I agree that I should receive occasional marketing. I understand that I can OPT-OUT of these emails at anytime.
Eric Church thumbnail
Eric Church

Eric is an experienced Certified FileMaker developer who enjoys using his creativity to solve challenging problems in a manner that will exceed customer expectations. He is friendly, engaging, and skilled at helping people simplify the complexities of their workflow.

FileMaker 18 Certified Developer
FileMaker 17 Certified Developer
FileMaker 16 Certified Developer
FileMaker 15 Certified Developer
FileMaker 14 Certified Developer
FileMaker 13 Certified Developer
FileMaker 12 Certified Developer
FileMaker 11 Certified Developer
"We were actually able to add more features than we thought would be possible within our budget. We always experienced a ‘can do’ attitude and DB Services was incredibly patient and easy to work with."
Courtney Hartman
Art Director
"The new FileMaker custom website interface is very user-friendly and easy to follow for our clients. In addition, it is much faster than the old Instant Web Publishing (IWP) interface. Thank you and all the others who have helped us out at DB Services. I am very grateful for the excellent service you provide us. Its nice to know we can call you for help if we have an issue."
Wayne Capek
President
"We needed a solution that would simplify the administration of our responsibilities under our contract with the State of Indiana. We have seen a dramatic increase across the state in the number of potential foster and adoptive parents that have begun the preparation and training process. This increase has resulted in a significant opportunity for children available for adoption. That’s a big win for everyone! And it’s all because we can refer potential parents to the proper state contacts efficiently and quickly."
Chris Morrison
Executive Director
"Thank you for all of your expertise and valuable help. I am so grateful to have found DB Services."
Linda Findlay
Owner
"Thank you for our new database system. We transitioned from a carbon copy paper based system to a digital database. The software has saved us time and money. We used to archive all our jobs in cabinets, now we can look up a job in seconds from anywhere. The software allows us to easily email estimates to our customers in pdf format. In a year there was a return on investment just from eliminating the purchasing of our carbon forms."
Todd Cartmel
Owner
"The new system allows us to create and track jobs for customers along with inventory, something we had been doing with separate word and spreadsheet files. Because it’s now so intuitive, new staff members are able to begin using the database immediately without our usual training session and ‘cheat sheets’ for getting around within the file."
Tom Andrews
President