Request URL for Twilio

Posted by mansaydirect@gmail.com on 07-Oct-2016 10:19

We are integrating the Twilio Messaging Application in AWM Direct, we wanted to save the reply received by Twilio to in our object. I would like to ask if it is possible to create a receiver for the Twilio Service (Inbound SMS) within the private instance server?

Posted by Santosh Patel on 20-Oct-2016 04:53

'to' and 'from' are integration names of fields in the communication log object. You don't need to use them. The point I was making was, you can have your SMS holder object with any field names. Your PHP middleware will intercept the message from Twilio and map the data from the request to the REST api 'createRecord'

All Replies

Posted by Santosh Patel on 08-Oct-2016 02:51

You can use the REST api to create your SMS record. See [View:https://www.twilio.com/docs/api/twiml/sms/twilio_request#synchronous:550:50] and create fields in your object with integration names same as parameters mentioned here.

Edit your twilio phone number and goto Messaging section. Choose webhook option for "A message comes in" and enter rest api url for createRecord. E.g. https://www.rollbase.com/rest/api/createRecord?objName=SMS&custId=86999999&loginName=xxxxxxxx&password=xxxxxxxx

Note that i'm using this form of authentication because I could not find options to configure basic auth in Twilio, but as this is a secure location, this should be fine. Configure objName, custId, loginname and password based on your tenant and account that you want to create the records with. The key assumption here is Twilio's parameter names match the integration names for fields in your Rollbase SMS object.

I was able to send an SMS to my Twilio number and a record with the body of the SMS was created in Rollbase.

Posted by mansaydirect@gmail.com on 11-Oct-2016 21:20

It works but there are fields from twilio that I cannot save in Rollbase since they are reserve words. I need them to save in  our record to track who is the sender. Reserve words are From and To. I already have these fields in my object but because it is reserved words the Integration name of these are From_ and To_ and the Twilio does not fill out these fields since their fields are From and To only.

Posted by Santosh Patel on 14-Oct-2016 02:20

We have noted the limitation on the keywords for integration names and will work towards removing them, if possible.

As you have a private instance, you can put in a custom JSP that can serve as middleware for this request. The JSP, say twilioReceiver.jsp, will read all parameters from the Twilio request and map it to your set of fields on the SMS holder object, making a subsequent call into Rollbase REST to create the SMS record.

Posted by mansaydirect@gmail.com on 14-Oct-2016 23:24

Can we use the PHP file as middleware?

Posted by Santosh Patel on 18-Oct-2016 06:49

Yes, you can have any middleware. You just need a place to map the Twilio parameters from the request to your record fields on the REST API.

Posted by mansaydirect@gmail.com on 19-Oct-2016 17:35

Hi what attribute that I can enable to have a To and From integration name fields? They are reserved words and I think they used in attributes of an object.

Posted by Santosh Patel on 20-Oct-2016 04:53

'to' and 'from' are integration names of fields in the communication log object. You don't need to use them. The point I was making was, you can have your SMS holder object with any field names. Your PHP middleware will intercept the message from Twilio and map the data from the request to the REST api 'createRecord'

This thread is closed