goyaptyltd / restfm Goto Github PK
View Code? Open in Web Editor NEWRESTful web services for FileMaker server.
Home Page: www.restfm.com
License: MIT License
RESTful web services for FileMaker server.
Home Page: www.restfm.com
License: MIT License
Any word on FMS 17 compatibility.
I have used RESTfm on FMS 14, 15, and 16, but had no luck updating to FMS 17.
I note the installer command sees 17 as incompatible.
Curious if you plan to support non-standard port numbers for web server?
Currently running on port 81 and 4431, RestFM diagnostics fail from what appears to be redirection to port 80 and/or 443
It should be possible to SELECT fields returned without requiring a WHERE clause. On Data API backend:
https://restfm/RESTfm-beta/postcodes/layout/full%20postcodes.json?RFMfind=SELECT%20Pcode
results in:
"X-RESTfm-FMDataAPI-Status": "400",
"X-RESTfm-FMDataAPI-Reason": "Find criteria are empty",
Thanks for making RESTfm open source and sharing it with the rest of the world, I love the tool, but have an issue:
I am running RESTfm in Filemaker Server 16 on a Mac Mini, I have been able to implement RESTfm for getting records, finding records and performing scripts, but I cannot use it for creating records, if I try to use the regular PHP XML I can create records just fine, but not with RESTfm.
Installation report page shows no errors and it saids RESTfm is working!
Here is my curl call:
curl -X POST
https://fms.domain.com/RESTfm/dataBaseName/layout/layoutName
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-d '{"data":[{"name":"Jimi","lastName":"Hendrix"}]}'
Here is what I get back:
{
"info": {
"X-RESTfm-FM-Status": null,
"X-RESTfm-FM-Reason": "",
"X-RESTfm-Version": "5.0.0/20170821-1ee8f4e",
"X-RESTfm-Protocol": "6",
"X-RESTfm-Status": 500,
"X-RESTfm-Reason": "FileMaker Error",
"X-RESTfm-Method": "POST",
"X-RESTfm-Trace": "exception 'RESTfm\BackendFileMaker\FileMakerResponseException' with message 'FileMaker Error' in /Library/FileMaker Server/HTTPServer/htdocs/RESTfm/lib/RESTfm/BackendFileMaker/FileMakerOpsRecord.php:88\nStack trace:\n#0 /Library/FileMaker Server/HTTPServer/htdocs/RESTfm/lib/RESTfm/OpsRecordAbstract.php(209): RESTfm\BackendFileMaker\FileMakerOpsRecord->_createRecord(Object(RESTfm\Message\Message), Object(RESTfm\Message\Record), 1)\n#1 /Library/FileMaker Server/HTTPServer/htdocs/RESTfm/lib/RESTfm/OpsRecordAbstract.php(167): RESTfm\OpsRecordAbstract->createBulk(Object(RESTfm\Message\Message))\n#2 /Library/FileMaker Server/HTTPServer/htdocs/RESTfm/lib/uriLayout.php(283): RESTfm\OpsRecordAbstract->createSingle(Object(RESTfm\Message\Message))\n#3 [internal function]: uriLayout->post(Object(RESTfm\Request), 'dataBaseName', 'layoutName')\n#4 /Library/FileMaker Server/HTTPServer/htdocs/RESTfm/lib/tonic/lib/tonic.php(695): call_user_func_array(Array, Array)\n#5 /Library/FileMaker Server/HTTPServer/htdocs/RESTfm/lib/RESTfm/Resource.php(54): Tonic\Resource->exec(Object(RESTfm\Request))\n#6 /Library/FileMaker Server/HTTPServer/htdocs/RESTfm/RESTfm.php(99): RESTfm\Resource->exec(Object(RESTfm\Request))\n#7 {main}",
"X-RESTfm-Profile": "122ms 2.2M 128M"
}
}
I just tried the RESTfm version before the last one just to test, but the result is the same.
I am running RESTfm version 4 on a IIS server and for the most part this version is great. I have one in to one issue and I am difficulty in understanding the behavior. I am search FM 15 for a possible set of records that match my search criteria with an understanding that in some cases no records will be found. The issue at hand is that RESTfm is returning a 500 Error over a 401 Error. The 500 error is where I see the issue as I would expect a simple JSON block with info status set to 401 which I can gracefully parse and process. The 500 error is not something I can ignore as it could be a more serious error. If you could help me understand why the application is returning a 500 error over a simple 401 it would be appreciated. I forgot to add if I am searching records were records are found everything works as advertised.
I can't seem to Authenticate any server calls using Angular 2. I have read the documentation here:
http://www.restfm.com/restfm-manual/web-api-reference-documentation/authentication
But I cat seem to get the basic authentication method or the RFMkey= method to work.
I have tried calling username:password@server/restfm/database and also tried modifying the RESTfm.ini.php configuration file.
I know modifying this file works because I can change the 401 vs 403 setting and watch the change on the front end. Can anyone point me toward good documentation or give me a simple authentication example.
I have no problem writing up the documentation for others once I can figure it out.
What is restfm Auth looking for?
Quick question please: Will RESTfm work on FMS 16? I just looked at the Filemaker new REST trial. It is REALLY primitive!!! I am thinking of upgrading my server to FMS16. I rather pay annual RESTfm sponsorship than using Filemake REST trial. (I know RESTfm is free. But I think we as FMP developers need to support awesome 3rd party solutions.)
Hope to hear from you and thanks.
With php 7.2, any argument to count must be "Countable".
lib/RESTfm/Format/FormatHtml.php
calls count on line 88 using the $section
variable created on line 84. $section
is a Section object defined in lib/RESTfm/Message/Section.php
which is not implementing Countable resulting in a warning being thrown.
Adding the following to lib/RESTfm/Message/Section.php should implement Countable and fix the warning.
insert at line 22 use Countable;
Change class declaration to class Section implements SectionInterface, Countable {...}
Add count method to the class similar to the following:
/**
* Returns an integer count of the number of rows.
*/
public function count() {
if ($this->getDimensions() == 1 && count($this->getRows()) > 0) {
return 1;
}
if ($this->getDimensions() > 1) {
return count($this->getRows());
}
return 0;
}
I really use RESTfm since some time and it's very useful, thanks.
Please add the SELECT DISTINCT option to the SQLParser. That would be great.
Markus
When I run the installer, a number of items fail for Mac OSX and I get an error saying that the current version of Mac OS X is unsupported. I'm running Sierra 10.12.2.
Greetings,
I wanted to check in on the availability and functionality of RESTfm running on FileMaker Server 19.
Looking for some guidance as this issue occurs on every fresh install of FMS 19.
It is probably something simple like the an extra include.
I am not a PHP expert and defer to the collective support knowledge here.
With or without extracting the
FM_API_for_PHP_Standalone.zip to
C:\Program Files\FileMaker\FileMaker Server\HTTPServer\conf\RESTfm\FileMaker
into the latest RESTfm (v5.2.3) folder does not overcome the issue below.
The PHP error from the localhost/RESTfm/report.php page when clicking the
http://localhost/RESTfm/RESTfm.php?RFMcheckFMAPI is as follows.
PHP Warning: md5_file(C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\php\FileMaker/Error/sv.php): failed to open stream: No such file or directory in C:\Program Files\FileMaker\FileMaker Server\HTTPServer\conf\RESTfm\lib\RESTfm\diagnostic_checks.php on line 59
I would note that the mentioned sv.php does not look exist at the paths mentioned in the error.
Here is the log:
OK: RESTfm version
5.2.3/20190606-181adf3
OK: PHP version
7.1.19
C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\php\php.ini
OK: PHP PDO drivers
none
OK: Web Server version
Microsoft-IIS/10.0
OK: Host Server version
Operating System Name : Windows NT
Host Name : 2CC59C
Release Name : 10.0
Version Information : build 14393 (Windows Server 2016)
Machine Type : AMD64
OK: Host Server date
2020-10-29 11:53:12 -06:00 (MDT - America/Denver)
OK: Install location
C:\Program Files\FileMaker\FileMaker Server\HTTPServer\conf\RESTfm
OK: baseURI (RESTfm.ini.php)
/RESTfm
OK: Web server redirect to RESTfm.php
http://localhost/RESTfm/?RFMversion
OK
ERROR: FileMaker PHP API
http://localhost/RESTfm/RESTfm.php?RFMcheckFMAPI
FileMaker PHP API not found in PHP include path.
ERROR: FileMaker Server connection test
Cannot test, FileMaker PHP API not found.
WARN: SSL enforced (RESTfm.ini.php)
SSLOnly not TRUE in RESTfm.ini.php
SSL is highly recommended to protect data, usernames and passwords from eavesdropping.
OK: PHP XSL extension
OK
Thank you,
Jonathan Travers
[email protected]
https://www.pacific-solutions.com/
PHP 7.1 is a stricter version that causes a notice to appear in the API response in RESTfm.php on line 196
First of all thank you for making this open source service available to us, and if it works we'll be sure to donate.
I tried to manually install the latest version of restFM.
I could not do the automated install because my ios version is 10.8.5.
Upon copying the folder and going to restfm/report php I get this log :
OK: RESTfm version
4.0.7/20160831-7b279f9
OK: PHP version
5.3.28
OK: PHP PDO drivers
sqlite, sqlite2
OK: Web Server version
Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/0.9.8zg
OK: Host Server version
Operating System Name : Darwin
Host Name : iMac-van-Carina-2.local
Release Name : 12.6.0
Version Information : Darwin Kernel Version 12.6.0: Wed Mar 18 16:23:48 PDT 2015; root:xnu-2050.48.19~1/RELEASE_X86_64
Machine Type : x86_64
OK: Host Server date
2016-09-15 15:57:11 +02:00 (CEST - Europe/Amsterdam)
OK: Install location
/Library/FileMaker Server/HTTPServer/htdocs/RESTfm
OK: baseURI (RESTfm.ini.php)
/RESTfm
ERROR: Web server redirect to RESTfm.php
<a href="http://localhost/RESTfm/?RFMversion">http://localhost/RESTfm/?RFMversion</a>
* Redirection not working, index.html was returned instead.
Instructions:
FileMaker Server 13/14 on Apple OSX instructions:
- Execute the RESTfm installer script by typing the following in a terminal:
sudo bash "/Library/FileMaker Server/HTTPServer/htdocs/RESTfm/contrib/install-RESTfm.OSX/install-RESTfm.OSX.command"
- Reload this page.
OK: FileMaker PHP API
<a href="http://localhost/RESTfm/RESTfm.php?RFMcheckFMAPI">http://localhost/RESTfm/RESTfm.php?RFMcheckFMAPI</a>
Found at path : /Library/FileMaker Server/Web Publishing/publishing-engine/php/mountain lion/lib/php/FileMaker.php
Version : 13
WARN: FileMaker Server connection test
http://127.0.0.1
<?xml version ="1.0" encoding="UTF-8" standalone="no" ?><!DOCTYPE fmresultset PUBLIC "-//FMI//DTD fmresultset//EN" "http://127.0.0.1:80/fmi/xml/fmresultset.dtd"><fmresultset xmlns="http://www.filemaker.com/xml/fmresultset" version="1.0"><error code="4"></error><product build="05/08/2015" name="FileMaker Web Publishing Engine" version="13.0.10.1003"></product><datasource database="" date-format="" layout="" table="" time-format="" timestamp-format="" total-count="0"></datasource><metadata></metadata><resultset count="0" fetch-size="0"></resultset></fmresultset>Connection is OK, but a warning applies:
FileMaker Server allowed the Guest Account to list databases.
The FileMaker Server Admin Console should be used to set Database Server -> Security to:
'List only the databases each user is authorized to access'
WARN: SSL enforced (RESTfm.ini.php)
SSLOnly not TRUE in RESTfm.ini.php
SSL is highly recommended to protect data, usernames and passwords from eavesdropping.
OK: PHP XSL extension
OK
I cannot follow the instructions under "Web server redirect to RESTfm.php error" because I have 10.8.5
According to documentation I should be able to install manually, what is the next step then?
It seems that I can't get web server redirect to work and I can't find documentation on what it needs.
Here is the report:
OK: RESTfm version
4.0.2/20160421-05839cf
OK: PHP version
5.5.14
OK: PHP PDO drivers
mysql, sqlite
OK: Web Server version
Apache/2.4.16 (Unix) OpenSSL/0.9.8zg
OK: Host Server version
Operating System Name : Darwin
Host Name : Concierge-Cleaning-Services.local
Release Name : 14.5.0
Version Information : Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64
Machine Type : x86_64
OK: Host Server date
2016-05-01 22:04:01 -07:00 (PDT - America/Los_Angeles)
OK: Install location
/Library/FileMaker Server/HTTPServer/htdocs/RESTfm
OK: baseURI (RESTfm.ini.php)
/RESTfm
ERROR: Web server redirect to RESTfm.php
<a href="http://localhost/RESTfm/?RFMversion">http://localhost/RESTfm/?RFMversion</a>
* Redirection not working, index.html was returned instead.
Instructions:
FileMaker Server 13/14 on Apple OSX instructions:
- Execute the RESTfm installer script by typing the following in a terminal:
sudo bash "/Library/FileMaker Server/HTTPServer/htdocs/RESTfm/contrib/install-RESTfm.OSX/install-RESTfm.OSX.command"
- Reload this page.
OK: FileMaker PHP API
<a href="http://localhost/RESTfm/RESTfm.php?RFMcheckFMAPI">http://localhost/RESTfm/RESTfm.php?RFMcheckFMAPI</a>
Found at path : /Library/FileMaker Server/Web Publishing/publishing-engine/php/yosemite/lib/php/FileMaker.php
Version : 14
WARN: FileMaker Server connection test
http://127.0.0.1
<?xml version ="1.0" encoding="UTF-8" standalone="no" ?><!DOCTYPE fmresultset PUBLIC "-//FMI//DTD fmresultset//EN" "http://127.0.0.1:16021/fmi/xml/fmresultset.dtd"><fmresultset xmlns="http://www.filemaker.com/xml/fmresultset" version="1.0"><error code="4"></error><product build="04/24/2015" name="FileMaker Web Publishing Engine" version="14.0.1.147"></product><datasource database="" date-format="" layout="" table="" time-format="" timestamp-format="" total-count="0"></datasource><metadata></metadata><resultset count="0" fetch-size="0"></resultset></fmresultset>Connection is OK, but a warning applies:
FileMaker Server allowed the Guest Account to list databases.
The FileMaker Server Admin Console should be used to set Database Server -> Security to:
'List only the databases each user is authorized to access'
WARN: SSL enforced (RESTfm.ini.php)
SSLOnly not TRUE in RESTfm.ini.php
SSL is highly recommended to protect data, usernames and passwords from eavesdropping.
OK: PHP XSL extension
OK
I manually added
# RESTfm - Mac OS X Apache 2.4 httpd config file for:
# FileMaker Server <= 12 and standalone systems without FMS installed.
<Directory "/Library/WebServer/Documents/RESTfm">
Options +SymLinksIfOwnerMatch
AllowOverride All
Require all granted
</Directory>
to my http.conf and restarted apache. No dice
It should be possible to inform RESTfm what base URI path is in use from outside a reverse proxy, which may be different to the directory that RESTfm is installed to (which is used by the report/diagnostic page to help installation problems). At worst this is a cosmetic issue with generated links and errors reported under diagnostics, otherwise RESTfm should work as expected.
I'm trying to update a record using PUT method over layout:
PUT: http://127.0.0.1:85/RESTfm/sos2/layout/PARAMETROS_00CLIENTS/71.json
(i'm sure record id its 71)
But give me following error
PHP Fatal error: Call to a member function setRecordId() on null in C:\inetpub\wwwroot\RESTfm\lib\uriRecord.php on line 150
Insert and read works well, but update fail :( any ideas?
Hi,
just want to inform you that we work on Python Client for restfm.
Kind regards,
René from the Stiftung Maria Ebene
Will FMS 18 be supported? Is it already supported? I'm having some issues updating this to use FMS 18.
A friendly installation report
I have a Windows 2016 server, FMS 15 running on aws.amazon. Following are what I had to do to make RESTfm work.
It took me many hours of trying. Luckily, I stumbled across an old post in 2010 dealing with the same issue, not seeing php working on windows 8 server. That gave me the clue to figure this out. Without that guy's post, I would never have figured it out. Therefore I would like to do my part of the contribution.
I hope this will help you happily REST away. :-)
What about portals and related records? When RESTfm will support it?
GET method aside, POST, PUT and DELETE method make critical operation result occasionally.
So to rollback for example, I wish logger function is implemented, which is able to selected in config file.
I'm happy if you consider this somtimes ;-)
Hey,
Nick pointed me to the 5.0 beta to install with FMS16. Most of it was working as expected, but we ran into a problem and was able to revert to 4.0.9 and it works.
5.0 Beta bug was using this: RFMfixFM02=1
Full URL:
httppost://dev.atlmac.com/RESTfm/GypsumHR/layout/device/85.json?key=*****&RFMformat=simple&RFMdata=data
persistent_id%3D"256E339563849ACCD79C0D3159A02C0A"&RFMfixFM02=1&RFMmethod=PUT
Cheers
Michael
We are currently developing a system that requires us to pass back custom error codes depending on why the filemaker script exits. When called, the script either returns the newly created record, the old record that should have been updated, or a random record. This happens regardless of any errors set within the filemaker script. What is the expected method of telling RESTfm that an error occurred within the script and passing that through to the client system?
Tried many times install on ubuntu 14, and always this error.
Checked all apache configs, and yet show this error.
http://107.170.1.19/RESTfm/?RFMversion
Redirection not working, index.html was returned instead.
Check the Apache httpd configuration has 'AllowOverride All' for the RESTfm directory.
OK: RESTfm version
4.0.1/UNKNOWN
OK: PHP version
5.5.9-1ubuntu4.14
OK: PHP PDO drivers
mysql
OK: Web Server version
Apache/2.4.7 (Ubuntu)
OK: Host Server version
Operating System Name : Linux
Host Name : crossasia-ru-erp-NY2
Release Name : 3.13.0-83-generic
Version Information : #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016
Machine Type : x86_64
OK: Host Server date
2016-04-20 06:33:14 -04:00 (EDT - America/New_York)
OK: Install location
/var/www/html/RESTfm
OK: baseURI (RESTfm.ini.php)
/RESTfm
ERROR: Web server redirect to RESTfm.php
http://107.170.1.19/RESTfm/?RFMversion
Redirection not working, index.html was returned instead.
Check the Apache httpd configuration has 'AllowOverride All' for the RESTfm directory.
OK: FileMaker PHP API
http://107.170.1.19/RESTfm/RESTfm.php?RFMcheckFMAPI
Found at path : /var/www/html/RESTfm/FileMaker/FileMaker.php
Version : 13
ERROR: FileMaker Server connection test
http://127.0.0.1
FileMaker Web Publishing Engine not found at configured hostspec.
WARN: SSL enforced (RESTfm.ini.php)
SSLOnly not TRUE in RESTfm.ini.php
SSL is highly recommended to protect data, usernames and passwords from eavesdropping.
ERROR: PHP XSL extension
Not Loaded. XSLT will not function.
Only RESTfm .simple, .xml, .json and .html formats are available.
Check that your Operating System has PHP XSL/XML packages installed.
Please, add composer and packagist declaration so this project could be used in a modern PHP-environment!
I've tried to search for an E-Mail Address in RESTfm:
This fails with 401 - No records match the request.
While this works:
Thanks for looking into this.
Rene
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.