SMS Gateway - Twilio
The Twilio SMS Gateway delivers SMS messages internationally. When setting up your Account in the fmSMS file follow the instructions in the Gateway Notes field. You will need to enter your Twilio Account SID in the Username field and your Twilio Auth Token in the Password field in the Accounts Screen - you can find these from your online Twilio account under the Account menu > API keys & tokens:
You can get incoming messages/replies to your Twilio number into the fmSMS file in several ways:
- Manually Download Incoming Messages
- Use Webhooks to have Twilio push these automatically to fmSMS using the supplied PHP files
- Use Claris Connect Webhooks
- Use Otto Webhooks
Using Webhooks is the preferred method as it saves you from having to poll/check for any new messages - with Webhooks new messages are forward to fmSMS automatically by Twilio as they are received.
Manual Download Incoming Messages
You can download incoming messages manually via the Account Details screen. Simply enter the date range you wish to download messages between and click the Get Incoming Messages button:
Any incoming messages to your Twilio number that have not been previously downloaded will then be downloaded. You could also setup a FileMaker Server script schedule to have this run on a scheduled basis (e.g.every hour) to save you from having to manually download/check for new messages - your script would just need to handle the incrementing of the timestamps.
Twilio PHP Webhooks Setup
To receive incoming SMS messages to your Twilio number, including replies to previously sent messages, you will need to use the supplied dedicatedNumberReply.php webhook file to act as the webhook receiver. See our Webhooks guide for what you need to do host the dedicatedNumberReply.php file on your chosen web server. Once you have the publicly accessible URL for this file you can enter this into your Twilio account settings as follows:
- login to your Twilio account via their website
- click on Phone Numbers in the side navigation (or go to https://www.twilio.com/console/phone-numbers/incoming)
- Click on your Twilio Number to edit it, then under Messaging selected Configure with Webhooks/TwiML
- select A Message Comes in “Webhook” and enter the URL in the adjacent field
- set the HTTP method to POST.
- click Save
It should look similar to this screenshot:
Twilio Claris Connect Webhooks Setup
Please visit the Twilio Webhooks using Claris Connect guide for instructions on setting up Claris Connect Webhooks for your Twilio number.
Twilio Otto Webhooks Setup
Please visit the Webhooks using Otto guide for instructions on setting up Otto Webhooks for your Twilio number.
Twilio first introduced Message Scheduling on August 24, 2022. Support for Message Scheduling was added in v4.2.11 of fmSMS. You will first need to create a Messaging Service and copy the Twilio MessagingServiceSid into the Custom Text 3 field in the Accounts Screen. For more information on using Messaging Services visit: