I have implemented Docusign Remote Signing Process and added phone authentication by setting identity verification for signer
signer.setIdentityVerification(recipientIdentityVerification());
public RecipientIdentityVerification recipientIdentityVerification() throws IOException, ApiException
{
RecipientIdentityPhoneNumber phoneNumber = new RecipientIdentityPhoneNumber();
phoneNumber.setCountryCode("+1");
phoneNumber.setNumber("**********");
RecipientIdentityInputOption inputOption = new RecipientIdentityInputOption();
inputOption.setName("phone_number_list");
inputOption.setValueType("PhoneNumberList");
inputOption.setPhoneNumberList(Arrays.asList(phoneNumber));
RecipientIdentityVerification identityVerifcation = new RecipientIdentityVerification();
identityVerifcation.setWorkflowId(getWorkflowID());
identityVerifcation.setInputOptions(Arrays.asList(inputOption));
return identityVerifcation;
}
Now if we give 10 digit random number, it throws an error code PHONE_NUMBER_INVALID with message Phonenumber is not valid. It only accepts genuine number for which we can get OTP. How to achieve this validation in my app. How can I validate phone numbers entered by our clients?