Webhook

Data API and cUrl is a great break through for the API economy, it would be great if we are able to receive Webhook at FileMaker Server.

Why this is important:

May web services like "online form", "facebook messenger api", "telegram", "weChat" etc, these big companies will not write a program to connect to our Data API to add record, they will just simply through a webhook to our server, now we have to write a web service by PHP or node.js to receive this webhook and then connect to filemaker Data API to add record, if FileMaker Data API have a function to receive webhook, it will save a lot of time to implement this middleware.

How it works:

Solution one: If I am able to create a table specially to receive webhook, when a webhook comes in, one record will be add automatically, this table only need two field, "request header" and "json".

Solution two: When a webhook comes in, I can decide a script to run, webhook data in script parameter, I can use get(scriptParameter) to obtain the data.

With "Data API", "cUrl" and "Webhook" these three tools, we can do almost everything about API.

cUrul is for us to reach out to other system to get data back, Data API is for others to come in to our system go obtain data, Webhook is for big platforms to though us a notification, say "Hey there are something for you here, come get it.", when we receive webhook, we can start our script to use "cUrl" to get that Data.

For our business partners, we can write program to connect to there API, and we can ask them to write program to connect to our API, but for those bit platforms, like Facebook, Telegram, we can not establish a Data API and ask them to write program to put data in to our system. Now the only way we can receive webhook webhook is to write a "middleware" by PHP or node.js or another technology, this middleware to receive webhook data then this middleware connect to our Data API to put data in. We need to rest a server and write node.js program, that takes a lot of time, and learning curve.

FileMaker is a great too for "Rapid development", I believe it will be great if FileMaker DataAPI can receive Webhook directly, only using FileMaker, we can connect to Facebook, Line, Telegram, Woocommerce... etc, that would be great.

The issue is that often you cannot fully control the request headers for a web hook with certain web services. FM Data API requires some specific headers and requires a fresh token if the one used is expired. This is a process that a simple web hook cannot do. If we could get permanent token options the web hook feature would be great.

Until we get permanent token options there needs to be an intermediate service that takes in the web hook request and then interacts with FMS.

Yesterday I ran into exactly this issue: in a project, the website developer wants to throw a webhook to the Filemaker server, saying "Hey, a new order has arrived on the website, the number is 1234. Come & get it", by POSTing a JSON message like

{

"type": "order",

"event": "create",

"key": 1234

}

to some URL https://webhook.site/some-secret-gui-code, with 2 header keys for security checking. When FMS receives such a call, FMS will call another website API to retrieve the full data about this order.

I could consider making some script to come close to the webhook way of working, but I'm almost certain I will not be able to meet the full standard.

So now I have to convince him to deviate from this webhook principle, and change it into a proper API call, where he will in fact create via Data API a record in a table that holds those 3 fields. The larger change is

he needs to go through the login procedure, instead of simply POSTing to a URL.

instead of having one uniform type of sending events to FMS, he'll need to craft each POST message according to my receiving API