MMS Gateway - ClickSend
The ClickSend MMS Gateway currently delivers MMS messages globally. You can use the following methods for attaching media files to your outgoing messages:
- Public URL: simply enter the publicly accessible URL for each media file that you wish to send. You would typically upload the file (jpeg or gif) to a server and determine the URL to that file and enter this into the URL field when sending an MMS message. N.B. ClickSend require certain media file formats to be first uploaded to ClickSend to be converted and return a URL you can use - fmMMS handles the uploading of images these to the uploads endpoint automatically when using the Gateway Direct method.
- Get Media Record URL: using the supplied getMediaURL.php file (versions for both the FileMaker Data API and the FileMaker PHP API are included) you can generate a dynamic URL on the fly that ClickSend can use to download a media file from the container field in the Media table record. This requires the fmMMS file to be hosted on FileMaker Server. Like the Public URL method this can only be used for certain media file formats (jpeg or gif) that aren't required to be first passed to the ClickSend uploads endpoint. N.B. the getMediaURL.php file currently doesn't work with FileMaker Cloud 2.x deployments due to the differences in how authentication is handled for FileMaker Cloud 2.x users with the Data API. We hope to have a version of the getMediaURL.php file that supports FileMaker Cloud 2.x soon.
- Gateway Direct: fmMMS will upload the file stored in the FileMaker container field directly to ClickSend who will store the media for 10 minutes. This effectively means that the URL that is returned for uploaded media should not be re-used in future outgoing messages as all files will expire 10 minutes after being uploaded.
You can get further information on supported media files and limitations here:
https://developers.clicksend.com/docs/rest/v3/#send-mms
https://developers.clicksend.com/docs/rest/v3/#ClickSend-v3-API-Upload
Incoming Messages/Replies
You can get incoming messages/replies to your ClickSend number into the fmMMS file in a number ways:
- Manually Download Incoming Messages
- Use Webhooks to have ClickSend push these automatically to fmMMS
- 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 forwarded to fmMMS automatically by ClickSend as they are received.
Manual Download Incoming Messages
You can download incoming messages manually via the Account Details screen. Simply click the Get Incoming Messages button:
Any incoming messages to your ClickSend number that have not been previously downloaded will then be downloaded, including any media attachments. 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.
ClickSend Webhooks Setup
To receive incoming MMS messages to your ClickSend number, including replies to previously sent messages, you will need to use the supplied WebhooksIncomingMessages.php webhook file to act as the webhook receiver. See our Webhooks guide for what you need to do host the WebhooksIncomingMessages.php file on your chosen web server. Once you have the publicly accessible URL for this file you can enter this into your ClickSend account settings as follows:
- login to your ClickSend account via their website
- click on your profile name in the top right hand corner and select Messaging Settings from the drop down menu
- make sure you are on the SMS & MMS tab and click the ADD NEW RULE button
- enter a name for the Rule, select your dedicated number (or choose Any) and in the Action field select URL and enter the URL in the URL field field that appears to the right
- click ADD
It should look similar to this screenshot:
You can test out the Webhook by clicking the Add Test Reply button when you click the Rule in the Edit Inbound Rule dialog box that appears.
ClickSend Otto Webhooks Setup
Please visit the Webhooks using Otto guide for instructions on setting up Otto Webhooks for your ClickSend number. You will need to create a new webhook and enter the Otto webhook URL using the instructions above and modify the OttoReceiver script to handle incoming MMS messages from ClickSend.