This sample shows how to use Vonage on Google App Engine Node.js standard environment and flexible environment
For more information about Vonage, see the Vonage SDK library.
Before you can run or deploy the sample, you will need to Do The Following:
- Create a Vonage Account
- Rent a Vonage Number
-
Configure the
Voice Receive
(https://{your-project-id}.appspot.com/call/receive) andSMS Inbound
(https://{your-project-id}.appspot.com/sms/receive) Webhook - If you deploy to the GCP. -
See Using Ngrok for local development for details of how to set up and use Ngrok for locall environment.
-
Configure your Vonage settings in the environment variables section in file
app.yaml-example
and rename toapp.yaml
. -
Export your Vonage settings in
app.sh-example
and rename toapp.sh
if you want run this in local development. -
Replace
private.key-example
with your applications'sprivate.key
file.
This is the sample application for the Quickstart for Node.js in the App Engine standard environment in the App Engine documentation.
npm install
gcloud app deploy
gcloud app browse
gcloud app logs tail -s default
npm update
source ./app.sh
npm start
curl -X POST -d 'from={Sender ID}&to={To Number}&text={Message Body}' http://{host}:{port}/sms/send
curl -X POST -d 'brand={Brand Name}&to={To Number}' http://{host}:{port}/verify/start
curl -X POST -d 'id={Request ID}&code={Verify Code}' http://{host}:{port}/verify/check
curl -X POST -d 'from={From Number}&to={To Number}&text={TTS Text}' http://{host}:{port}/voice/call
Set the http://{host}:{port}/voice/receive on your VONAGE_NUMBER, call on the number to check receive.
Set the http://{host}:{port}/voice/dtmf on your VONAGE_NUMBER, call on the number to check DTMF.
Set the http://{host}:{port}/voice/asr on your VONAGE_NUMBER, call on the mumber to check ASR.