File tree Expand file tree Collapse file tree 2 files changed +36
-2
lines changed
src/main/java/com/nexmo/quickstart/verify Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ repositories {
14
14
15
15
dependencies {
16
16
testCompile ' junit:junit:4.12'
17
-
18
- compile ' com.nexmo:client:5.1 .0'
17
+
18
+ compile ' com.nexmo:client:5.2 .0'
19
19
compile " com.sparkjava:spark-core:2.6.0"
20
20
compile ' javax.xml.bind:jaxb-api:2.3.0'
21
21
}
Original file line number Diff line number Diff line change
1
+ package com .nexmo .quickstart .verify ;
2
+
3
+ import com .nexmo .client .NexmoClient ;
4
+ import com .nexmo .client .verify .VerifyResponse ;
5
+ import com .nexmo .client .verify .VerifyStatus ;
6
+ import com .nexmo .client .verify .VerifyRequest ;
7
+
8
+ import static com .nexmo .quickstart .Util .configureLogging ;
9
+ import static com .nexmo .quickstart .Util .envVar ;
10
+
11
+ public class StartVerificationWithWorkflow {
12
+ public static void main (String [] args ) throws Exception {
13
+ configureLogging ();
14
+
15
+ String NEXMO_API_KEY = envVar ("NEXMO_API_KEY" );
16
+ String NEXMO_API_SECRET = envVar ("NEXMO_API_SECRET" );
17
+
18
+ String RECIPIENT_NUMBER = envVar ("RECIPIENT_NUMBER" );
19
+ String NEXMO_BRAND = envVar ("BRAND_NAME" );
20
+
21
+ VerifyRequest request = new VerifyRequest (RECIPIENT_NUMBER ,NEXMO_BRAND );
22
+
23
+ request .setWorkflow (VerifyRequest .Workflow .TTS_TTS );
24
+
25
+ NexmoClient client = NexmoClient .builder ().apiKey (NEXMO_API_KEY ).apiSecret (NEXMO_API_SECRET ).build ();
26
+ VerifyResponse response = client .getVerifyClient ().verify (request );
27
+
28
+ if (response .getStatus () == VerifyStatus .OK ) {
29
+ System .out .printf ("RequestID: %s" , response .getRequestId ());
30
+ } else {
31
+ System .out .printf ("ERROR! %s: %s" , response .getStatus (), response .getErrorText ());
32
+ }
33
+ }
34
+ }
You can’t perform that action at this time.
0 commit comments