Skip to content

Commit 65dbeef

Browse files
committed
adding sample with workflow
1 parent 55792b7 commit 65dbeef

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
}

0 commit comments

Comments
 (0)