- Description
- Pre-Requisites
- Environmental Variables
- Callback URLs
- Firebase Configuration
- Running the Application
This project is a Node.js application that manages notifications between the Bandwidth API and a client (Android/iOS/React) to facilitate notifications of incoming inbound calls.
In order to use the Bandwidth API, users need to set up the appropriate application at the Bandwidth Dashboard and create an API user.
To create an application, log into the Bandwidth Dashboard and navigate to the Applications
tab. Fill out the New Application form; selecting the service (Voice) that the application will be used for. All Bandwidth services require publicly accessible Callback URLs, for more information on how to set one up see Callback URLs.
For more information about API credentials see our Account Credentials page.
The sample app uses the below environmental variables.
LOCAL_PORT # The port number you wish to run the sample on
For a detailed introduction, check out our Bandwidth Voice Callbacks page.
Below are the callback paths:
/health
/initiate
This sample application utilizes firebase to assist in sending notifications to the client.
- Follow the Firebase Setup Guide to instantiate the
admin-service.json
file imported at initiate.js:line:8 - Create a new web project and follow the straightforward instructions provided in the link here.
To install the required packages for this application, run the following command:
npm install
To run the application, run the following command:
npm start
To use this webhook service, make it publicly accessible. There are many ways to accomplish this - but for simplicity and ease of use we recommend ngrok to get started.
A simple way to set up a local callback URL for testing is to use the free tool ngrok.
After you have downloaded and installed ngrok
run the following command to open a public tunnel to your port ($LOCAL_PORT
)
ngrok http $LOCAL_PORT
You can view your public URL at http://127.0.0.1:4040
after ngrok is running. You can also view the status of the tunnel and requests/responses here. Once your public ngrok url has been created, you can set it in the voice application created in the Pre-Requisites section.