4 Replies Latest reply on May 26, 2017 7:50 AM by martinc

    Receiving SMS Text Messages Using Twilio

    bendavis1957

      In my solution, I have an obvious field or "window" on my sms layout where I enter the text of my outgoing text message.  But what about return texts?  I know that they can be seen and read if I log into my Twilio account and enter the message logs, but isn't there a way that I can actually read them in my solution as well?  Should there be a "return text" field that displays incoming text messages?

        • 1. Re: Receiving SMS Text Messages Using Twilio
          databuzz

          Hi,

           

          Generally with SMS Gateways like Twilio you'll need to either poll for new messages and download them or have Twilio push them to your FileMaker solution. We do this in our fmSMS solution (http://www.fmsms.com/ ) we get Twilio to push incoming messages/replies to FileMaker Server (your file has to be hosted on FileMaker Server and have Custom Web Publishing enabled).

           

          I don't believe Twilio allows you to poll/download new messages on demand.

          • 2. Re: Receiving SMS Text Messages Using Twilio
            martinc

            Hello Ben,

             

            Were you able to collect responses to the outgoing texts?

             

            This could be a fantastic way to broaden the reach of FM.

             

            Thanks

             

            Martin

            • 3. Re: Receiving SMS Text Messages Using Twilio
              bhamm

              I realize the original post is a little stale (Sep), but I thought I'd reply for anyone who might stumble onto the thread later. Or just to present another option. This is how I'd probably approach it:

               

              While I'm not familiar with the fmSMS product @databuzz mentioned, another way to grab incoming SMS content would be to write some PHP capturing $_REQUEST['Body'] and add that as a new record in your database, in a 'responses' table. Like this:

               

              $record->setField( 'smsContent', $_REQUEST['Body'] )

               

              You would do that in the same PHP file containing the Twilio $response object.

               

              *And* if you already had the sender's cell number in an existing record, you could precede the $record->setField() call with a find request for $_REQUEST['From'], get the matching record, and add the message content as a related record.

              • 4. Re: Receiving SMS Text Messages Using Twilio
                martinc

                We ended up turning on PHP and using php to grab incoming items from twillio that changed corresponding records.  It's pretty slick.  The only hang up is that the response only relates to the last message sent to an individual.  If we send a second message to a tech and he has not responded to the previous message, he can only respond to the most recent message.  The communication has to work like a teeter tooter A:B A:B.  Most people are used to more fluid communication

                 

                With the advancement of the json and such, this should become much more viable.