Build SMS Text Message Into Your Web Apps : Twilio API
Posted by mindfirephp2013
Twilio API:
It allows building apps that send and receive SMS using phone numbers. This API helps to enable users to communicate with your app.
How it works?
We can use it with the help of different languages i.e. PHP, PYTHON, RUBY, JAVA, .NET, PERL
How to Start?
It’s very to start with Twilio. Before, going to coding; first create your account in Twilio.
- Create account in Twilio.
- Get verified your mobile number.
It will provide you Twilio phone number and you can start with your test account; to get more features you have to upgrade your account.
You can also choose your number from different regions. But, Twilio still not started with Indian numbers. When you go to your dashboard, there you can see Twilio provides Account SID and Auth Token for your account which Twilio use to get details for the account.
I used this twilio API in Code Igniter.
Sending Text Message via REST API
- Download the Twilio-PHP library for CI
- Put config file “twilio.php” inside config folder and twilio library file into libraries folder.
3. Create your controller to handle text message.
4. Go to your twilio account and set URL which will call your script and SAVE.
Here, now all set. 🙂 Now, you can do message to twilio number and twilio will respond you back with message “Hi! I am from Twilio API” for this code. 🙂
Additional Features:
Under Dev Tools tab, you can monitor your API. You can check for your error here.
Other good one is Logs tab.
It maintain all log details related to messaging like time, to, from and SMS body. You can also create CSV of your logs.
The interesting feature is you can also set Geographic permissions for message sending and receiving.
I found this API very interesting to work.
You can use this API in your project for various purposes like Alert Notification, Advertising, create Conversational Apps, Reminders, Promotions, Location based Services, etc. I hope this will help to save your lot of time while implementing this feature for your site.
Written By: Naincy Gupta, Software Engineer, Mindfire Solutions
Posted on March 18, 2014, in PHP and tagged .NET, Create account in Twilio, Geographic permissions for message, JAVA, Mindfire Solutions, Naincy Gupta, PERL, PHP, PYTHON, RUBY, Software Engineer, Text Message via REST API, Twilio API, Twilio-PHP library for CI. Bookmark the permalink. Leave a comment.
Leave a comment
Comments 0