Node.js Voice Quickstart
Build a simple Node.js application that answers a call and plays a message to the caller.
You're ready for this quickstart if you've got the following:
A free trial account
A registered application
A configured FreeClimb Number
Your language and tools:
Clone your quickstart
For this quickstart, clone the repository for Node Getting Started Tutorial using GitHub's interface or git in the command line.
git clone https://github.com/FreeClimbAPI/Node-Getting-Started-Tutorial.git
Add your credentials to your project
Now that you've cloned the repo for your sample app, the next step is to add your API credentials so you can authenticate with FreeClimb. To do this, first copy your account ID and API key from your dashboard homepage.


Your API credentials can be copied from your Dashboard homepage.
Create a .env file in the root directory of your repo. Make sure to add the file to your .gitignore file. Add your account ID and API key to your .env file, and save the file. Your .env file should look something like this:
ACCOUNT_ID=YOUR-ACCOUNT-TOKEN
API_KEY=YOUR-API-KEY
The quickstart uses dotenv to read in your credentials, and anything else you save, as environment variables.
Make your local server publicly accessible
The fastest way to start testing your FreeClimb application is to temporarily make your local server publicly accessible through a tunneling service. We'll use ngrok to do this. Start by downloading ngrok. Unzip the file to install, then open your terminal and navigate to the directory where you've unzipped ngrok. Use the following command to start a HTTP tunnel on port 80.
./ngrok http 80
Once you run ngrok you should receive a response with a public URL, that looks something like this:
ngrok by @inconshreveable
Tunnel Status online
Version 2.0/2.0
Web Interface http://127.0.0.1:4040
Forwarding http://92832de0.ngrok.io -> localhost:80
Forwarding https://92832de0.ngrok.io -> localhost:80
Connnections ttl opn rt1 rt5 p50 p90
0 0 0.00 0.00 0.00 0.00
The Forwarding URLs point to your local server. Save the URLs and go on to the next step.
Configure your application's endpoints
Now that you've got a public URL you're ready to configure your application's endpoints. We'll be configuring the voiceUrl using your ngrok URL and the route reference /incomingCall
.
Go to the Apps page in your dashboard. You should see your registered FreeClimb app.


Your Apps page with your registered app
Open its App Config, and you'll see its application ID, alias, and some options for URL configuration. Enter your ngrok URL into the voiceUrl field, and add the route /incomingCall
at the end of the URL.
https://YOUR-URL.ngrok.io/incomingCall
When you're done the App Config should look something like this:


Example of a completed app config
Save your updated App Config.
Run your app
Once you've updated your App Config with your public URLs you're all ready to run your app! Run the quickstart application with the command:
node gettingStarted-2.js
Once the quickstart app is running, dial your configured FreeClimb number. If everything is set up right, you should hear the message "Hello world!" and then the call will end.
Congratulations! You've just made your first voice calling application!
Next steps
For a more detailed explanation of the code used, see our Accept an Incoming Call tutorial.
Updated 3 months ago