How REST works in soSIMPLE Calendar
If you’re managing a larger installation of soSIMPLE Calendar, with many, many users and many, many events with a lot of navigation and editing and maybe some unstored calculations thrown in, you may have noticed some slow-down on your calendar. Especially at peak time. Looking at the server during those times will likely show many PHP connections to your server. Well, soSIMPLE 3.6 was made for you (even if you’re not using FileMaker 16 or REST). We’ve optimized how those connections are used for both PHP & the new REST API.
The new REST API in FileMaker 16 was built from the ground up, separate from the older PHP API. As a result, it adds a new level of scaleability and manageability to the existing toolset. That means heavy simultaneous activity is better managed on the server, so your overall speed and reliability will be improved.
We really wanted to give you the flexibility to completely move over to REST, and no longer be reliant on the PHP API. However, the new API doesn’t yet do everything that the PHP API can do.
So we came up with a creative solution.
After you enable REST in config.php, we use the REST API anywhere we can. And we gracefully fall back to the PHP API where ever we can’t.
For the technically-focused, here’s where we use REST:
- Updating events from the server as you edit them,
- Polling for/downloading events as you navigate the calendar.
Here’s where we continue using PHP:
- Initial population of events on the calendar when it’s first drawn (to get resources and custom value lists)
- All event updates when you’re using server-side advanced scripting (REST doesn’t support server-side scripts yet)
While you’re actively using the calendar, we maintain a single REST connection to FileMaker Server for each calendar user. This connection times out after 15 minutes of inactivity, then is automatically reconnected when activity resumes.
How to Enable REST in soSIMPLE Calendar
There are only three things you need to do turn on the new REST features in soSIMPLE 3.6
- Upgrade to FileMaker Server 16
- Add REST permissions to your database
- Update config.php with $method = ‘REST’;
1. Upgrade to FileMaker Server 16
FileMaker 16 adds a new Data API along with a bevy of new features.
So to use this new feature in soSIMPLE 3.6, you’ll need to upgrade to FileMaker Server 16.
Make sure when you install FileMaker Server 16, you deploy it with BOTH PHP & the Data API.
IMPORTANT: In order to use REST at all, your server needs to be installed with a valid secure certificate, not the built-in one.
2. Add REST permissions to your database
In order to use REST with your own solution (using our 5-minute integration) you will need to turn on BOTH FMPHP and FMREST extended privilege for the user configured in your data source in soSIMPLE Calendar Settings.
IMPORTANT: this is separate from to the new FMURLSCRIPT extended privilege that is now required for logged in users in FileMaker Pro 16 and FileMaker Go 16
3. Update config.php with $method = ‘REST’;
When you downloaded soSIMPLE Calendar, it included a sosimple web directory which you placed on your FileMaker server or your web server.
Included in that folder is a small file called “config.php”. Generally you don’t edit that file – unless you have a multiple server installation, or some other special-use cases.
In soSIMPLE 3.6 (you NEED to have this version – REST is not supported in earlier versions), there is a line that reads
$method = “PHP”;
To enable REST, change that to
$method = “REST”;
This will turn on all available REST features in soSIMPLE Calendar.
Please enjoy soSIMPLE 3.6.
Let us know your experiences with the new REST engine.
P.S. If you’re doing your own PHP/REST development, feel free to use our FREE fmREST.php class to simplify development, and help manage data connections.