Quickstarts also available for: .NET, Node.js, PHP, Python, Ruby
The purpose of the quickstart guide is to provide simple examples focused on one goal. For example, sending and SMS, handling an incoming SMS webhook, making a Text to Speech call.
To use this sample you will first need a Nexmo account.
For some of the examples you will need to buy a number.
You will need to have Gradle installed to build the code. Once you have gradle installed, run the following to build a jar that contains the quickstart code along with all the nexmo client library dependencies:
gradle assemble
This will build the following file: build/libs/nexmo-java-quickstart-with-dependencies.jar
Copy .env-example
to .env
and edit the values. You'll need to load those
values into environment variables, so you'll probably want to use a tool like
Foreman to run your code like this:
foreman run java -cp build/libs/nexmo-java-quickstart-with-dependencies.jar CLASS
So to run the OutboundTextToSpeechExample class, you would run the following:
foreman run java -cp build/libs/nexmo-java-quickstart-with-dependencies.jar com.nexmo.quickstart.voice.OutboundTextToSpeech
If you set the environment variable QUICKSTART_DEBUG
to any value, extra information
will be output to the console from the Nexmo Client library.
Please raise an issue to request an example that isn't present within the quickstart. Pull requests will be gratefully received.
This code is licensed under the MIT license.