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 |
|---|---|
ControlResponse |
advanceVerification(java.lang.String requestId)
Advance a current verification request to the next stage in the process.
|
ControlResponse |
cancelVerification(java.lang.String requestId)
Cancel a current verification request.
|
CheckResponse |
check(java.lang.String requestId,
java.lang.String code)
Validate a code provided by a user in response to a call from
verify. |
CheckResponse |
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. |
VerifyResponse |
psd2Verify(Psd2Request psd2Request)
Send a PSD2 verification request to a phone number with optional parameters
|
VerifyResponse |
psd2Verify(java.lang.String number,
java.lang.Double amount,
java.lang.String payee)
Send a PSD2 compliant payment token to a user for payment authorization
|
VerifyResponse |
psd2Verify(java.lang.String number,
java.lang.Double amount,
java.lang.String payee,
Psd2Request.Workflow workflow)
Send a PSD2 compliant payment token to a user for payment authorization with a pin verification workflow
|
SearchVerifyResponse |
search(java.lang.String... requestIds)
Search for a previous verification request.
|
SearchVerifyResponse |
search(java.lang.String requestId)
Search for a previous verification request.
|
VerifyResponse |
verify(java.lang.String number,
java.lang.String brand)
Send a verification request to a phone number.
|
VerifyResponse |
verify(java.lang.String number,
java.lang.String brand,
java.lang.String from)
Send a verification request to a phone number.
|
VerifyResponse |
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.
|
VerifyResponse |
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.
|
VerifyResponse |
verify(java.lang.String number,
java.lang.String brand,
VerifyRequest.Workflow workflow)
Send a verification request to a phone number with a pin verification workflow
|
VerifyResponse |
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 VerifyResponse verify(java.lang.String number, java.lang.String brand) throws NexmoResponseParseException, 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.NexmoClientException - if there was a problem with the Nexmo request or response objects.NexmoResponseParseException - if the response from the API could not be parsed.public VerifyResponse verify(java.lang.String number, java.lang.String brand, VerifyRequest.Workflow workflow) throws NexmoResponseParseException, 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.workflow - workflow
to use for sending verification pinNexmoClientException - if there was a problem with the Nexmo request or response objects.NexmoResponseParseException - if the response from the API could not be parsed.public VerifyResponse verify(java.lang.String number, java.lang.String brand, java.lang.String from) throws NexmoClientException, NexmoResponseParseException
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.NexmoClientException - if there was a problem with the Nexmo request or response objects.NexmoResponseParseException - if the response from the API could not be parsed.public VerifyResponse verify(java.lang.String number, java.lang.String brand, java.lang.String from, int length, java.util.Locale locale) throws NexmoClientException, NexmoResponseParseException
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 numberNexmoClientException - if there was a problem with the Nexmo request or response objects.NexmoResponseParseException - if the response from the API could not be parsed.public VerifyResponse verify(java.lang.String number, java.lang.String brand, java.lang.String from, int length, java.util.Locale locale, VerifyRequest.LineType type) throws 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.NexmoClientException - if there was a problem with the Nexmo request or response objects.NexmoResponseParseException - if the response from the API could not be parsed.public VerifyResponse verify(VerifyRequest request) throws NexmoClientException, NexmoResponseParseException
request - validation request for the 2FA verification.NexmoClientException - if there was a problem with the Nexmo request or response objects.NexmoResponseParseException - if the response from the API could not be parsed.public CheckResponse check(java.lang.String requestId, java.lang.String code) throws NexmoClientException, NexmoResponseParseException
verify.requestId - (required) The requestId returned by the verify call.code - (required) The code entered by the user.NexmoClientException - if there was a problem with the Nexmo request or response objects.NexmoResponseParseException - if the response from the API could not be parsed.public CheckResponse check(java.lang.String requestId, java.lang.String code, java.lang.String ipAddress) throws NexmoClientException, NexmoResponseParseException
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.NexmoClientException - if there was a problem with the Nexmo request or response objects.NexmoResponseParseException - if the response from the API could not be parsed.public SearchVerifyResponse search(java.lang.String requestId) throws NexmoClientException, NexmoResponseParseException
requestId - The requestId of a single Verify request to be looked up.null
if no record was found.NexmoClientException - if there was a problem with the Nexmo request or response objects.NexmoResponseParseException - if the response from the API could not be parsed.public SearchVerifyResponse search(java.lang.String... requestIds) throws NexmoClientException, NexmoResponseParseException
requestIds - The requestIds of Verify requests to be looked up.NexmoClientException - if there was a problem with the Nexmo request or response objects.NexmoResponseParseException - if the response from the API could not be parsed.public ControlResponse advanceVerification(java.lang.String requestId) throws NexmoClientException, NexmoResponseParseException
requestId - The requestId of the ongoing verification request.ControlResponse representing the response from the API.NexmoClientException - if there was a problem with the Nexmo request or response objects.NexmoResponseParseException - if the response from the API could not be parsed.public ControlResponse cancelVerification(java.lang.String requestId) throws NexmoClientException, NexmoResponseParseException
requestId - The requestId of the ongoing verification request.ControlResponse representing the response from the API.NexmoClientException - if there was a problem with the Nexmo request or response objects.NexmoResponseParseException - if the response from the API could not be parsed.public VerifyResponse psd2Verify(java.lang.String number, java.lang.Double amount, java.lang.String payee) throws NexmoClientException, NexmoResponseParseException
number - Telephone number to verify, in E.164 formatamount - payment amountpayee - name of the person the payment is for. Name will be included in the messageVerifyResponse representing the response from the API.NexmoClientException - if there was a problem with the Nexmo request or response objects.NexmoResponseParseException - if the response from the API could not be parsed.public VerifyResponse psd2Verify(java.lang.String number, java.lang.Double amount, java.lang.String payee, Psd2Request.Workflow workflow) throws NexmoClientException, NexmoResponseParseException
number - telephone number to verify, in E.164 formatamount - payment amountpayee - name of the person the payment is for. Name will be included in the messageworkflow - workflow
to use for sending verification pinVerifyResponse representing the response from the API.NexmoClientException - if there was a problem with the Nexmo request or response objects.NexmoResponseParseException - if the response from the API could not be parsed.public VerifyResponse psd2Verify(Psd2Request psd2Request) throws NexmoClientException, NexmoResponseParseException
psd2Request - request to to send PSD2 verification to a phone.NexmoClientException - if there was a problem with the Nexmo request or response objects.NexmoResponseParseException - if the response from the API could not be parsed.