Twilio allows software developers to programmatically make and receive phone calls and send and receive text messages using its web service APIs

To get started you need to Sing Up. Visit the official site Twilio — https://www.twilio.com/ and click to Get a Free API Key

TWILIO_SIGN_UP

complete registration form

TWILIO_SIGN_UP_FORM

confirm your phone number

TWILIO_CONFIRM_PHONE_NUMBER_1

TWILIO_CONFIRM_PHONE_NUMBER_2

and get your first twilio phone number

TWILIO_FIRST_PHONE_NUMBER_1

TWILIO_FIRST_PHONE_NUMBER_2

TWILIO_FIRST_PHONE_NUMBER_3

Now you can go to the page Get Started with SMS and to practice.

If before sending SMS you will get a Error - 21408 “Permission to send an SMS has not been enabled for the region indicated by the ‘To’ number”. Just click on the following link https://www.twilio.com/user/account/settings/international/sms and apply the appropriate for you Geographic Permissions

Once you have finished with the Get Started with SMS and got your phone number, You can go to the console where you will get your Twilio Credentials https://www.twilio.com/console

TWILIO_CREDENTIALS

Now you can use your credentials in the following code replacing the corresponding values as you want

server.js

// Twilio Credentials 

var accountSid = 'accountSid';
var authToken = 'authToken';

// Require the Twilio module and create a REST client

var client = require('twilio')(accountSid, authToken);

client.messages.create({
	to: 'ToNumber', // You can only send messages to verified numbers in trial

	from: 'FromNumber', // https://i.imgur.com/gf0Ujid.png

	body: 'Text'
}, function(err, message) {
	console.log(message.sid);
});

install twilio package with npm install twilio and run this code with node server.js


Mikhail

I am Mikhail Evdokimov, a Web Developer and Perfectionist from Russia, Far East, Vladivostok. Enthusiast performance, responsive design and usability, always looking for the best project and good coffee. Love JavaScript and JavaScript Full Stack Development. MongoDB, ExpressJS, AngularJS, NodeJS. Also I can use a few Ruby and Lua for Corona SDK. In my blog, I plan to write not only about development but also about my other hobbies and interests.