Code snippets are short pieces of code you can reuse in your own applications. The code snippets use code from example repositories.
Please read this information carefully, so you can best use the code snippets.
- Create a Vonage account
- Rent a Vonage Number
- Install the Vonage Command Line tools
- Create a Vonage Application using the command line tools or Dashboard
- Install the Vonage Library for your programming language
- Set up Ngrok
The following replaceable information depends on the library and specific call:
||Your Vonage API key (see it on your dashboard).|
||Your Vonage API secret (also available on your dashboard).|
||Private key path.|
||The Vonage Application ID.|
All phone numbers are in E.164 format.
||Your Vonage Number. E.g.
||The number you are calling. E.g.
||The number you are forwarding to. E.g.
UUIDs are typically used in the code snippets to identify a specific call.
||The UUID of the call leg|
Some code snippets have more specialized variables that will need to be replaced by actual values. These may be specified on a per-code snippet basis.
The main ones you will meet here are:
/webhooks/answer- Vonage makes a GET request here when you receive an inbound call. You respond with an NCCO.
/webhooks/event- Vonage makes POST requests here when an event occurs. You receive a JSON event.
/webhooks/recordings- Vonage makes a POST request here when the recording is available. You receive a JSON object with recording details.
/webhooks/dtmf- Vonage POSTs user DTMF input here in a JSON object.
If you are using Ngrok you will set your webhook URLs in the Vonage Application object to something like:
demo in the above with whatever applies in your case.