Jump to content
Sign in to follow this  
  • entries
    16
  • comments
    0
  • views
    564

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

Sign in to follow this  
Marina Syhanath

351 views

myFMbutler — 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.

Lesterius co-creates FileMaker Platform based solutions with their customers. Sharing knowledge is in our DNA, that’s why we developed this library to make the FileMaker Data API easy-to-use with Javascript.

1*mLxQxlp3TbGBiyJY3d60Cw.jpegPhoto by Artem Beliaikin on Pexels

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.

1*QeBgI9y4y928CDq-FADJ-w.pngstat?event=post.clientViewed&referrerSource=full_rss&postId=63fb69940510

myFMbutler — myFMApiLibrary for Javascript, one library to rule them all, again was originally published in Lesterius on Medium, where people are continuing the conversation by highlighting and responding to this story.


Afficher la totalité du billet

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...