This project is pre-configured to do some interesting Twilio stuff using node.js and the Express web framework.
We assume that before you begin, you will have node.js and npm and installed on your system. Before you can run this project, you will need to set three system environment variables. These are:
TWILIO_ACCOUNT_SID
: Your Twilio "account SID" - it's like your username for the Twilio API. This and the auth token (below) can be found on your account dashboard.TWILIO_AUTH_TOKEN
: Your Twilio "auth token" - it's your password for the Twilio API. This and the account SID (above) can be found on your account dashboard.TWILIO_NUMBER
: A Twilio number that you own, that can be used for making calls and sending messages. You can find a list of phone numbers you control (and buy another one, if necessary) in the account portal.
For Mac and Linux, environment variables can be set by opening a terminal window and typing the following three commands - replace all the characters after the =
with values from your Twilio account:
export TWILIO_ACCOUNT_SID=ACXXXXXXXXX
export TWILIO_AUTH_TOKEN=XXXXXXXXX
export TWILIO_NUMBER=+16518675309
To make these changes persist for every new terminal (on OS X), you can edit the file ~/.bash_profile
to contain the three commands above. This will set these environment variables for every subsequent session. Once you have edited the file to contain these commands, run source ~/.bash_profile
in the terminal to set up these variables.
On Windows, the easiest way to set permanent environment variables (as of Windows 8) is using the setx
command. Note that there is no =
, just the key and value separated by a space:
setx TWILIO_ACCOUNT_SID ACXXXXXXXXX
setx TWILIO_AUTH_TOKEN XXXXXXXXX
setx TWILIO_NUMBER +16518675309
Download the project source code directly or clone the repository on GitHub. Navigate to the folder with the source code on your machine in a terminal window.
You will first need to install the application's dependencies. You can do this using npm, the bundled package manager for node.js:
npm install
Now, you should be able to launch the application. From your terminal, run node app.js
. This should launch your Express application on port 3000 - visit that URL on your local host. Enter your mobile number in the fields provided, and test both SMS text messages and phone calls being sent to the mobile number you provide.
If your phone receives both a call and text message, you're good to go!
This is your first step into the Twilio learning program. Return to the site to continue on. Huzzah!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.