public class VerifyClient extends AbstractClient
NexmoClient.getVerifyClient().
Send a verification request with a call to verify, confirm the code entered by the user with
check, and search in-progress or completed verification requests with search
More information on method parameters can be found at Nexmo website: https://docs.nexmo.com/verify
httpWrapper| Constructor and Description |
|---|
VerifyClient(HttpWrapper httpWrapper)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
advanceVerification(java.lang.String requestId)
Advance a current verification request to the next stage in the process.
|
void |
cancelVerification(java.lang.String requestId)
Cancel a current verification request.
|
CheckResult |
check(java.lang.String requestId,
java.lang.String code)
Validate a code provided by a user in response to a call from
verify. |
CheckResult |
check(java.lang.String requestId,
java.lang.String code,
java.lang.String ipAddress)
Validate a code provided by a user in response to a call from
verify. |
SearchResult[] |
search(java.lang.String... requestIds)
Search for a previous verification request.
|
SearchResult |
search(java.lang.String requestId)
Search for a previous verification request.
|
VerifyResult |
verify(java.lang.String number,
java.lang.String brand)
Send a verification request to a phone number.
|
VerifyResult |
verify(java.lang.String number,
java.lang.String brand,
java.lang.String from)
Send a verification request to a phone number.
|
VerifyResult |
verify(java.lang.String number,
java.lang.String brand,
java.lang.String from,
int length,
java.util.Locale locale)
Send a verification request to a phone number.
|
VerifyResult |
verify(java.lang.String number,
java.lang.String brand,
java.lang.String from,
int length,
java.util.Locale locale,
VerifyRequest.LineType type)
Send a verification request to a phone number.
|
VerifyResult |
verify(VerifyRequest request)
Send a verification request to a phone number.
|
public VerifyClient(HttpWrapper httpWrapper)
httpWrapper - (required) shared HTTP wrapper object used for making REST calls.public VerifyResult verify(java.lang.String number, java.lang.String brand) throws java.io.IOException, NexmoClientException
number - (required) The recipient's phone number in E.164
format.brand - (required) The name of the company or app to be verified for. Must not be longer than 18
characters.java.io.IOException - if a network error occurred contacting the Nexmo Verify API.NexmoClientException - if there was a problem with the Nexmo request or response objects.public VerifyResult verify(java.lang.String number, java.lang.String brand, java.lang.String from) throws java.io.IOException, NexmoClientException
number - (required) The recipient's phone number in E.164
format.brand - (required) The name of the company or app to be verified for. Must not be longer than 18
characters.from - (optional The Nexmo number to use as the sender for the verification SMS message and calls, in
E.164 format.java.io.IOException - if a network error occurred contacting the Nexmo Verify API.NexmoClientException - if there was a problem with the Nexmo request or response objects.public VerifyResult verify(java.lang.String number, java.lang.String brand, java.lang.String from, int length, java.util.Locale locale) throws java.io.IOException, NexmoClientException
number - (required) The recipient's phone number in E.164
format.brand - (required) The name of the company or app to be verified for. Must not be longer than 18
characters.from - (optional The Nexmo number to use as the sender for the verification SMS message and calls, in
E.164 format.length - (optional) The length of the verification code to be sent to the user. Must be either 4 or 6. Use
-1 to use the default value.locale - (optional) Override the default locale used for verification. By default the locale is determined
from the country code included in numberjava.io.IOException - if a network error occurred contacting the Nexmo Verify API.NexmoClientException - if there was a problem with the Nexmo request or response objects.public VerifyResult verify(java.lang.String number, java.lang.String brand, java.lang.String from, int length, java.util.Locale locale, VerifyRequest.LineType type) throws java.io.IOException, NexmoClientException
number - (required) The recipient's phone number in E.164
format.brand - (required) The name of the company or app to be verified for. Must not be longer than 18
characters.from - (optional The Nexmo number to use as the sender for the verification SMS message and calls, in
E.164 format.length - (optional) The length of the verification code to be sent to the user. Must be either 4 or 6. Use
-1 to use the default value.locale - (optional) Override the default locale used for verification. By default the locale is determined
from the country code included in numbertype - (optional) If provided, restrict the verification to the specified network type. Contact
support@nexmo.com to enable this feature.java.io.IOException - if a network error occurred contacting the Nexmo Verify API.NexmoClientException - if there was a problem with the Nexmo request or response objects.public VerifyResult verify(VerifyRequest request) throws java.io.IOException, NexmoClientException
java.io.IOExceptionNexmoClientExceptionpublic CheckResult check(java.lang.String requestId, java.lang.String code) throws java.io.IOException, NexmoClientException
verify.requestId - (required) The requestId returned by the verify call.code - (required) The code entered by the user.java.io.IOException - if a network error occurred contacting the Nexmo Verify API.NexmoClientException - if there was a problem with the Nexmo request or response objects.public CheckResult check(java.lang.String requestId, java.lang.String code, java.lang.String ipAddress) throws java.io.IOException, NexmoClientException
verify.requestId - (required) The requestId returned by the verify call.code - (required) The code entered by the user.ipAddress - (optional) The IP address obtained from the HTTP request made when the user entered their code.java.io.IOException - if a network error occurred contacting the Nexmo Verify API.NexmoClientException - if there was a problem with the Nexmo request or response objects.public SearchResult search(java.lang.String requestId) throws java.io.IOException, NexmoClientException
requestId - The requestId of a single Verify request to be looked up.java.io.IOException - if a network error occurred contacting the Nexmo Verify API.NexmoClientException - if there was a problem with the Nexmo request or response objects.public SearchResult[] search(java.lang.String... requestIds) throws java.io.IOException, NexmoClientException
requestIds - The requestIds of Verify requests to be looked up.java.io.IOException - if a network error occurred contacting the Nexmo Verify API.NexmoClientException - if there was a problem with the Nexmo request or response objects.public void advanceVerification(java.lang.String requestId) throws java.io.IOException, NexmoClientException
requestId - The requestId of the ongoing verification request.java.io.IOException - If an IO error occurred while making the request.NexmoClientException - If the request failed for some reason.public void cancelVerification(java.lang.String requestId) throws java.io.IOException, NexmoClientException
requestId - The requestId of the ongoing verification request.java.io.IOException - If an IO error occurred while making the request.NexmoClientException - If the request failed for some reason.