fmMMS Webhooks using Otto

Otto from Proof+Geist can be used to receive incoming messages from your MMS Gateway. You will need to make a few small modifications to your copy of fmMMS - we've added support for Otto webhooks in v1.25 of fmMMS. 

If you're using an earlier version of fmMMS the required changes are outlined on the Otto website here and include creating a new layout, 2 new fields and 1 new script. You can copy/paste the OttoReceiver script from the v1.25 file to your file. Your new OttoReceiver layout (based on the Messages table) should look like this:

In the following example we will show you how to create an Otto webhook to receive incoming MMS messages from the Twilio MMS Gateway (similar to the WebhooksIncomingMessages.php file). 

Once you've made the necessary changes you need to create a new Otto Data API key by following the instructions here. We recommend using the supplied OttoDeveloperAPI.fmp12 FileMaker file to create the key which only takes a few minutes. When creating the Data API Key you can use the same FileMaker account that the WebhooksIncomingMessages.php file uses here as it has the required access privileges for receiving incoming webhooks via the Data API:

Once you've generated the Data API Key for the fmMMS file you can make a note of the URL for the MMS Gateway webhook. We are using the query parameter option to handle the authentication. The webhook URL should look something like this:

https://otto-server-url:3030/receiver/fmMMS.fmp12/fmMMS?apiKey=<your-api-key> 

You now need to enter the Otto webhook URL in your MMS Gateway account. The process for this will be different for each MMS Gateway - you can get more information for your MMS Gateway on the MMS Gateways page. For the Twilio MMS Gateway that we are using in this example you will need to login to your Twilio account and click on Phone Numbers in the side navigation then click on the Twilio Number you wish to enter the Otto webhook for. Under Messaging select the Configure with Webhooks/TwiML option then select A Message Comes in “Webhook” and enter the Otto webhook URL in the adjacent field and click Save. It should look similar to this screenshot:

You now need to test the webhook by sending a message from your phone to your Twilio number to simulate an incoming MMS message - it should create a new record on the OttoReceiver layout and populate the Payload field with the content of the incoming message and then populate the appropriate fields with the data from the payload, as well as create any media attachments that were sent with the message. If you look at the same record on the Messages Form layout you should see the the new record with the appropriate data in the Contact, Message Body, Media fields etc.

As the OttoReceiver script in v1.25 of the fmMMS file is designed to process incoming messages from the Twilio MMS Gateway you will need to modify the following highlighted steps of the OttoReceiver script to process incoming messages from other supported MMS Gateways:

If you will be receiving incoming messages from more than one MMS Gateway we recommend creating Otto webhooks for each MMS Gateway and setting the Channel value in the webhook URL to the name of the MMS Gateway. You can then branch in the OttoReceiver script for each MMS Gateway by referencing the value in the Channel field.

Still need help? Contact Us Contact Us