Using Twilio to send SMS with Cloud Code

Step 1: Create Twilio Account

Go to and create a Account

If the thing goes well, there are a simple tutorial to let you send SMS to your phone. After that you will receive your first Phone Number for your Twilio Account.

If you can not find your phone number, go to # phone Number (you may use it at the cloud code when testing.)screen-shot-2016-09-22-at-5-44-12-pm

Step 2: Get Account SID and Auth Token

Go to Home -> Dashboard


Copy your SID and Auth Token for Cloud Code.

Step 3: Implement Cloud Code

 //require the Twilio module and create a REST client
 var client = require('twilio')('AccountSID','AuthToken');
 //Send an SMS text message
 // you can use request.params to pass the number you want to send
 to:'+target test Phone number', // Any number Twilio can deliver to
 from: '+Your first Phone number', // A number you bought from Twilio and can use for outbound communication
 body: 'SMS From Cloud Code.' // body of the SMS message

 }, {
 function(error, responseData) {
   if (error) {
      // console.log(error);
   } else {
      // console.log(responseData);

Step 4: Test