Wow, almost exactly a year since my last post. How some things change and other things don't.
On the one hand my father has passed away almost a year ago and that has left a big hole in our lives. On the other hand a year ago BitCoin was at it's peak and was days away from jumping off the cliff. Well it fell from about $19,000 all the way to $6000 where it has held for many months...until yesterday when it jumped off the cliff again.
On to Twilio - I'm blown away with how easy it is to get communication components accomplished with Twilio. We are using it for normal SMS text messages at TapCloud. We also use it to send out our Authy based 2-Factor authentication tokens, and we are starting to use it for peer-to-peer and one-to-many video conferencing.
One of the great things about Twilio is just how easy it is to use. Here's an example of just a handful of code that will let you go from start to finish so you'll be sending out MMS messages in about 5 minutes. For those that don't know, MMS messages appear just like text messages (SMS) but they can also include media such as video, images, and sound. MMS stands for Multimedia Messaging Service which is a lot harder to say than MMS.
Cutting to the chase, here's the ColdFusion code. Obviously, use your own Auth Credentials which you can easily get by signing up with Twilio (www.twilio.com). Due credit, this is based a lot on a very similar example by Ben Nadel.
twilio.accountSID = "111111";
twilio.authToken = "2222222";
twilio.phone = "+18475555555";
mediaUrl = "https://app.tapcloud.com/s/assets/sodiumfacts2.pdf";
twilioRequest = new Http(method = "post",
url = "https://api.twilio.com/2010-04-01/Accounts/#twilio.accountSID#/Messages",
username = twilio.accountSID,
password = twilio.authToken
);
twilioRequest.addParam(
type = "formfield",
name = "From",
value = twilio.phone
);
twilioRequest.addParam(
type = "formfield",
name = "To",
Value = "+18475555555"
);
twilioRequest.addParam(
type = "formfield",
name = "MediaUrl",
value = mediaUrl
);
twilioRequest.addParam(
type = "formfield",
name = "Body",
value = "The Doctor has asked that you follow these Salt guidelines for today:"
);
result = twilioRequest.send();
Believe it or not, that's all it is to it. You are using your Twilio phone number in one variable, your destination phone number in another, and an URL pointing to your multimedia object in yet another variable. Save that as a .CFM and run it and you'll be sending MMS messages to your heart's content.
On the one hand my father has passed away almost a year ago and that has left a big hole in our lives. On the other hand a year ago BitCoin was at it's peak and was days away from jumping off the cliff. Well it fell from about $19,000 all the way to $6000 where it has held for many months...until yesterday when it jumped off the cliff again.
On to Twilio - I'm blown away with how easy it is to get communication components accomplished with Twilio. We are using it for normal SMS text messages at TapCloud. We also use it to send out our Authy based 2-Factor authentication tokens, and we are starting to use it for peer-to-peer and one-to-many video conferencing.
One of the great things about Twilio is just how easy it is to use. Here's an example of just a handful of code that will let you go from start to finish so you'll be sending out MMS messages in about 5 minutes. For those that don't know, MMS messages appear just like text messages (SMS) but they can also include media such as video, images, and sound. MMS stands for Multimedia Messaging Service which is a lot harder to say than MMS.
Cutting to the chase, here's the ColdFusion code. Obviously, use your own Auth Credentials which you can easily get by signing up with Twilio (www.twilio.com). Due credit, this is based a lot on a very similar example by Ben Nadel.
twilio.accountSID = "111111";
twilio.authToken = "2222222";
twilio.phone = "+18475555555";
mediaUrl = "https://app.tapcloud.com/s/assets/sodiumfacts2.pdf";
twilioRequest = new Http(method = "post",
url = "https://api.twilio.com/2010-04-01/Accounts/#twilio.accountSID#/Messages",
username = twilio.accountSID,
password = twilio.authToken
);
twilioRequest.addParam(
type = "formfield",
name = "From",
value = twilio.phone
);
twilioRequest.addParam(
type = "formfield",
name = "To",
Value = "+18475555555"
);
twilioRequest.addParam(
type = "formfield",
name = "MediaUrl",
value = mediaUrl
);
twilioRequest.addParam(
type = "formfield",
name = "Body",
value = "The Doctor has asked that you follow these Salt guidelines for today:"
);
result = twilioRequest.send();
Done!
Believe it or not, that's all it is to it. You are using your Twilio phone number in one variable, your destination phone number in another, and an URL pointing to your multimedia object in yet another variable. Save that as a .CFM and run it and you'll be sending MMS messages to your heart's content.
I like the work which you have placed in this article. This data is significant and superb. I might want to thank you for sharing this article here. affordable text marketing
ReplyDeleteThanks for this... very easy to grasp. I find Nadel's examples too much. This is straight to the point.
ReplyDeleteThis is very nice, and I have it saving all sent messages in a database. But the question I have is how to save the return messages in a database, including the MediaURL data if someone send a picture back in response
ReplyDeleteAlso, how do you get the Twilio smsSID data back from Twilio when you send a message?
ReplyDelete