Web Niraj
  • Facebook
  • Flickr
  • Github
  • Linkedin
  • Twitter
  • YouTube
Online portfolio, code examples and developer blog
  • About
  • Contact
  • Portfolio
  • WordPress
Search the site...
  • Home
  • Blog
  • Twilio API: Sending a Text Message

Twilio API: Sending a Text Message

2

I’ve been experimenting with the Twilio API recently and have found it very easy to automatically send text messages or call a telephone programmatically. In fact, you are able to send a text message in just a few lines of code. Such a service can use used to validate mobile phone numbers for an app, much like how Facebook does.

Using the Twilio PHP library, sending a message can be achieved in a few lines of code.

The above 12 lines of code is enough to send a simple message to any mobile phone. Making a phone is even easier, and I’ll cover that in a later post.

Twilio doesn’t have a JavaScript SDK, unfortunately, so you would have to create a server-side API (using PHP) and then use JavaScript (with jsonp) to call the API. This again is quite straight forward to do in JavaScript, but requires more coding on the back-end (PHP) to secure the script.

SMS, Tutorial, Twilio

2 comments on “Twilio API: Sending a Text Message”

  1. Abdul Saboor says:
    March 20, 2016 at 4:43 PM

    HOW are you?
    I want to use Ywillio APi for sending Data(JSON) from my Android app to the server because i have no internet connection. Please guide me if u have any suggestion for me, Thank’s A lot.

    Reply
    • Niraj Shah says:
      March 20, 2016 at 6:04 PM

      You won’t be able to use Twilio unless you have Internet. Otherwise, how are you going to send data to the server? That’s how the API works. But you can probably use Twilio to receive and process a text message from your app, and then sent a response back to the device using text, but that may work out quite expensive.

      Reply

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

StackExchange / StackOverflow

profile for Niraj Shah on Stack Exchange, a network of free, community-driven Q&A sites

Support Me

Buy Me a Coffee

PSN Profile

Tags

ACL Amazon Amazon Web Services Android Android 4.4 KitKat Android 5.0 Lollipop Apache Backup Bug Command Line Cordova cPanel / WHM Facebook Facebook Graph API Facebook PHP SDK 4.0 Facebook Social Plugins Fan Page Firewall Flash Gadget Geolocation Google Nexus 5 Hacking HTML5 iOS JavaScript jQuery Laravel 5 Linux NodeJS Parse PDF PHP Plugin Portfolio PS4 Review Security Server SSH SSL Sysadmin Tutorial WordPress WordPress Plugins
© 2011-2025 Niraj Shah
  • Blog
  • Portfolio
  • WordPress
  • About Me
  • Contact Me
  • Privacy Policy
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Privacy Policy