Skip to content

aguin467/Twilio-Messaging-Javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twilio-Messaging

Messaging your phone number from the Twilio api using Javscript Code used

  • This assumes that you know how to use the cli/terminal in GNU/Linux
  • This also assumes that you use vscode as your IDE
  • Finally, this assumes that you already have obtained your TWILIO_ACCOUNT_SID and AUTH_TOKEN

 

  • Install nodejs
sudo apt install nodejs -y

 

  • Install npm
sudo apt install npm -y

 

  • Install Twilio
npm install twilio

 

  • Create a folder in the terminal
mkdir folder name

 

  • CD into that folder
cd folder name

 

  • Make sure to input your twilio_sid_token and auth_token
const client = new Twilio("TWILIO_ACCOUNT_SID", "AUTH_TOKEN");

 

  • Open up vscode in the terminal
code .

 

  • Then run the command
node explore.js

 

  • This will gather your most recent sent messages in Twilio
client.messages
.list()
    .then(messages => console.log(`The most recent message is ${messages[0].body}`)
    ).catch(err => console.error(err));

 

  • You are done :shipit:

About

Message a phone number using the Twilio api

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published