From 85a06bb3753d645e0a1dbcb60e31dafc39964293 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Thu, 10 Oct 2019 21:07:15 -0400 Subject: [PATCH 1/4] Fixing command in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 444e90c..4575ccb 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ foreman run java -cp build/libs/nexmo-java-quickstart-with-dependencies.jar CLAS So to run the OutboundTextToSpeechExample class, you would run the following: ```sh -foreman run java -cp build/libs/nexmo-java-quickstart-with-dependencies.jar com.nexmo.quickstart.voice.OutboundTextToSpeech +foreman run java -cp build/libs/nexmo-java-code-snippets-with-dependencies.jar com.nexmo.quickstart.voice.OutboundTextToSpeech ``` If you set the environment variable `QUICKSTART_DEBUG` to any value, extra information From 3021b04c4fb12a4331b4e393b1cf86d257c87c07 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Thu, 10 Oct 2019 21:12:22 -0400 Subject: [PATCH 2/4] fixing env example --- .env-example | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.env-example b/.env-example index 16f35d9..f0f52bb 100644 --- a/.env-example +++ b/.env-example @@ -1,7 +1,7 @@ -API_KEY=YOUR_API_KEY -API_SECRET=YOUR_API_SECRET -APPLICATION_ID=YOUR_APPLICATION_ID -PRIVATE_KEY=PATH_TO_YOUR_KEY_FILE +NEXMO_API_KEY=NEXMO_API_KEY +NEXMO_API_SECRET=NEXMO_API_SECRET +NEXMO_APPLICATION_ID=NEXMO_APPLICATION_ID +NEXMO_PRIVATE_KEY_PATH=NEXMO_PRIVATE_KEY_PATH NEXMO_NUMBER=YOUR_NEXMO_NUMBER TO_NUMBER=NUMBER_TO_CALL RECIPIENT_NUMBER=YOUR_RECIPIENTS_NUMBER From 55792b782ddea60480e657e35e95576138847512 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Fri, 18 Oct 2019 16:35:14 -0400 Subject: [PATCH 3/4] Updating to 5.2.0 --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 5d8fbdf..bb360a8 100644 --- a/build.gradle +++ b/build.gradle @@ -14,8 +14,8 @@ repositories { dependencies { testCompile 'junit:junit:4.12' - - compile 'com.nexmo:client:5.1.0' + + compile 'com.nexmo:client:5.2.0' compile "com.sparkjava:spark-core:2.6.0" compile 'javax.xml.bind:jaxb-api:2.3.0' } From 65dbeef88a7049cd0b998c88c143abcd134c8462 Mon Sep 17 00:00:00 2001 From: slorello89 Date: Fri, 18 Oct 2019 17:07:13 -0400 Subject: [PATCH 4/4] adding sample with workflow --- .../verify/StartVerificationWithWorkflow.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/main/java/com/nexmo/quickstart/verify/StartVerificationWithWorkflow.java diff --git a/src/main/java/com/nexmo/quickstart/verify/StartVerificationWithWorkflow.java b/src/main/java/com/nexmo/quickstart/verify/StartVerificationWithWorkflow.java new file mode 100644 index 0000000..b820fd8 --- /dev/null +++ b/src/main/java/com/nexmo/quickstart/verify/StartVerificationWithWorkflow.java @@ -0,0 +1,34 @@ +package com.nexmo.quickstart.verify; + +import com.nexmo.client.NexmoClient; +import com.nexmo.client.verify.VerifyResponse; +import com.nexmo.client.verify.VerifyStatus; +import com.nexmo.client.verify.VerifyRequest; + +import static com.nexmo.quickstart.Util.configureLogging; +import static com.nexmo.quickstart.Util.envVar; + +public class StartVerificationWithWorkflow { + public static void main(String[] args) throws Exception { + configureLogging(); + + String NEXMO_API_KEY = envVar("NEXMO_API_KEY"); + String NEXMO_API_SECRET = envVar("NEXMO_API_SECRET"); + + String RECIPIENT_NUMBER = envVar("RECIPIENT_NUMBER"); + String NEXMO_BRAND = envVar("BRAND_NAME"); + + VerifyRequest request = new VerifyRequest(RECIPIENT_NUMBER,NEXMO_BRAND); + + request.setWorkflow(VerifyRequest.Workflow.TTS_TTS); + + NexmoClient client = NexmoClient.builder().apiKey(NEXMO_API_KEY).apiSecret(NEXMO_API_SECRET).build(); + VerifyResponse response = client.getVerifyClient().verify(request); + + if (response.getStatus() == VerifyStatus.OK) { + System.out.printf("RequestID: %s", response.getRequestId()); + } else { + System.out.printf("ERROR! %s: %s", response.getStatus(), response.getErrorText()); + } + } +}