AnsweredAssumed Answered

Connect JavaScript with DataAPI FMS17. Help.

Question asked by molotovi on Dec 11, 2018
Latest reply on Dec 13, 2018 by molotovi

Hello Everyone!


I had been working with Google Maps on FIleMaker.

I had the solution working perfect with FM Pro Advanced 17, using FMUrlScript (FMP). So, the last week I worked with the implementation with WebDirect and my nightmare started .


* I used XML CWP solution, but doesn't work because the parameter lenght are too long, and doesn't work well.


So, I'm trying to send a HTTP Request from JavaScript to the DataAPI, but I'm doing some wrong and I don't have idea what could be wrong.


I have two ways to do that:


With Fetch (Updated):

function callAPI()

var URL = 'https://[Server]/fmi/data/v1/databases/[DB_Name]/sessions';
var data = btoa("[user]:[password]"); //Encode Base64

var otherParam =
headers: new Headers(
{"Authorization":"Basic " + data,
body: {}

.then(blob => blob.json())
.then(data => {
document.querySelector("pre").innerHTML = JSON.stringify(data, null, 2);
return data;
.catch(e => {
return e;

// This code return: "Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID"
// Working on Windows 10 and Chrome and Mozilla at day.




  1. The Server doesn't have SSL yet (May be the friday I'll install it)
  2. I rode some "wrappers", but I don't have idea how to use these wrappers, the documentation is not clear to me.


Finally, I need to call a script and pass a parameter from JavaScript, I need to change the JSON data that I'm sending?