
Following this, you're creating a new Voice Client object, creating objects for your "from" and "to" phone numbers with the type "phone".

In the above code, within the main() function first retrieves the value of your private key file (Which should be called private.key), it then creates an auth object using your Application id and your private.key. Import ( "fmt" "io/ioutil" "/vonage/vonage-go-sdk" "/vonage/vonage-go-sdk/ncco" ) func main ( ) Finally, update TO_NUMBER with your number that you expect to receive the call. Note: be sure to update the PATH_TO_PRIVATE_KEY_FILE to be the path to your private key file (including the private key file name), your APPLICATION_ID with the application Id you noted down earlier in the tutorial, update the VONAGE_NUMBER to your recently purchased Vonage virtual number. In your project directory (where you also saved your private.key file, create a new file called make-an-outbound-call-ncco.go and enter the following code: It's now time to write your code to make this text to speech voice call. You've now purchased a Vonage virtual number and created a Vonage Application. The page that now loads will display your Application ID. My suggestion for this would be to use ngrok, which we have an excellent tutorial for here.

If you wish to handle these yourself, you'll need to build two webhooks in your application to receive the requests, and then expose your webhooks to the Internet.

However, as you are required to enter these fields form, you're welcome to put a URL such as: " " and " ". *Note: For this tutorial you don't need to set up webhooks to handle the two fields required: "Event" and "Answer". Give your new application a name and then select "Generate public and private key", this downloads the private.key file for you which you should then move the file to be alongside the code you are about to create. Purchase one, go to Numbers > Buy Numbers and searchĬreate an application under "Your Applications" in the Dashboard. This tutorial also uses a virtual phone number. You can find your API Key and API Secret at the top of the Today and start building with free credit. To complete this tutorial, you will need aĪPI account.
