Skip to content

Web technologies

myFMApiLibrary for Javascript, one library to rule them all, again

The Lesterius Team has developed a Javascript library to make the FileMaker Data Api 18 easier to use.

Why do we provide a wrapper while the data REST API already works?

To make it simple.

In our library, we’ve already coded all cURL requests. You don’t need to read the FileMaker Data API documentation to make it work, you just have to follow our documentation. Readable by every Javascript developer, you can use it even if you don’t know anything about FileMaker. Even better: this library doesn’t have any dependencies, just add it in a webViewer and start using it! Download it and it’s ready.

Go to our GitHub and download it or do a composer install:

composer require myfmbutler/myfmapilibrary-for-js

See how to enable FileMaker Data Api on your FileMaker Server with this video, then create a user with the fmrest privilege and allow them to access your target data and layouts.

Here is an example that shows how to find records with credentials method login (if you’re using WebDirect, please, use the token method for more security):

<!DOCTYPE html>
<html lang="en">
 <head>
     <meta charset="UTF-8">
     <title>My html page</title>
     <script src="DataApi.js"></script>
 </head>
 <body>
  <script type="text/javascript">
      let apiURL          = "https://test.fmconnection.com/fmi/data";
      let login           = "User";
      let password        = "password";
      let databaseName    = "MyDatabase";
      let layoutName      = "My Layout";      console.log("Login to the FileMaker Server");      let options = {
          'apiUrl': apiURL,
          'databaseName' : databaseName,
          'login' : login,
          'password' : password
      };      let api = new DataApi(options);      console.log("Find records");      let search = [
          {
              'fields' : {'fieldname': 'First Name', 'fieldvalue': '==John'},
              'options' : {'omit': false}
          }
      ];      let sort = [
          {
              'fieldName': 'First Name',
              'sortOrder': 'ascend'
          },
          {
              'fieldName':'Last Name',
              'sortOrder':'descend'
          }
      ];      // My results are here
      console.log(api.findRecords(layoutName, search, sort));      console.log("Logout");
      api.logout();
  </script>
 </body>
</html>

Enjoy! You can also see all the examples in the readme here.

What’s the difference with others libraries?

  • No depencies
  • One file only
  • A “token method” for login (WebDirect usage)
  • Ready for FileMaker 18
  • Readable by every developer, even beginners

JOIN US ON GITHUB!

Free download

Download the latest version and documentation from GitHub.

Written by Lucie Guilbert.

  • Custom solutions

    Curious what we can do for your company?

    Read more

  • Lesterius helps

    We offer three services

    Consultancy

    Training

    Hosting

  • Upcoming event

  • Lesterius ins and outs

    Stay tuned

    • This field is for validation purposes and should be left unchanged.
  • Claris Platinum Partner

You might find these articles interesting too

Developer Notes: NFC and Claris FileMaker
Lowie Sanctobin

Developer Notes

The end of an era...
Koen Van Hulle

Developer Notes

Importing data in a FileMaker database from a “flat file”

Claris FileMaker