The messages.create() method is provided by the Twilio library, which is used to create the message sent. The account_sid and auth_token is provided by Twilio when you signup, copy and paste them here. The Twilio module connects the app to your Twilio account.In the preceding code, the Twilio API is used to send a message to the mobile number. To: '+13072205075' // use your phone number or receiver number Now inside index.js add the following code const client = require('twilio')('account_sid', 'auth_token') īody: 'This is message is sent from a node app',įrom:'+16014882966', // use your twilio number here npm i twilio : This installs the Twilio npm package that enables us to use the Twilio API.Īfter you have executed the preceding commands your file structure will look like this: twilioSms.This file holds the meta-data of our application. npm init -y : The command creates a package.json file.Navigate to the twilioSms directory through the command line on your code editor or use gitbash to run the following commands: Now let's focus on building the application. Now create a folder on your machine called twilioSms, this will be the directory of our application. You will be given a free trial number and some other details that we will use later. Virtual Phone Number: A virtual phone number that will enable us to receive SMS online(get one here) or you can use your personal phone numberĪfter installing NodeJS, create and verify your Twilio account.Download NodeJS here, if you don't have it already on your machine. NodeJS: A platform built on Chrome's Javascript runtime for easily building fast, scalable network applications.Don't have a Twilio account? sign up for free here. We will be using a few tools to build this app, so you will need to set them up before proceeding Through its cloud-hosted API, we are able to integrate voice, SMS(texting), and video functionalities into an application. Twilio is a customer engagement platform.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |