A demo that implements a Delivery Notification Service in Express and the Nexmo Text Messages API.
The number-form branch is the starting point of the tutorial and is just a simple Express app that lets a user submit a phone number.
First off ensure you have Node installed.
- Clone this repository
- Run
git checkout number-form
- Run
npm install
- Run
npm start
- Visit http://localhost:3000
- Submit a number
The delivery-notifications branch is the end point of our tutorial, taking the number submitted and sending a notification to the user. Additionally it listens to incoming SMS messages to confirm a user's choice.
The differences between these two branches can be seen here and in our in-dept tutorial.
- Clone this repository
- Run
git checkout delivery-notifications
- Run
npm install
- Copy
.env.example
to.env
and add your Nexmo API key and secret, and add Nexmo phone number - Run
npm start
- Visit http://localhost:3000
- Submit your own phone number
To receive incoming messages make sure your local server is available publicly. An easy way to do this is to use Ngrok.
Then set up your SMS webhook which is easy to do with the nexmo-cli.
nexmo link:sms 445555555555 http://<your_id>.ngrok.com/response
This sample is released under the MIT License