IsValid
 

IsValid

Definition

bool IsValid ( string username, string password, string number, Option[] options )

Description:

Checks a North America telephone number for validity.

If the service returns false, the supplied telephone number is invalid and cannot be called. If the service returns true, the telephone number is likely to be valid. This does not necessarily mean that the number can be called and is owned by the expected person, but does indicate that the number lies in an exchange that has been allocated for use.

Options:

USTelephoneValidation.Country
Indicates the North American country that the number must be in to be considered valid. This should be provided as the ISO 2-character country code.

USTelephoneValidation.State
Indicates the US state that the number must be in to be considered valid. This should be provided as the common 2-character state abbreviation.

View all North America Telephone Validation Methods

Code Samples

Language:

<!-- Import the Integr8 Ajax API -->
<!-- NOTE: Get your own API key to use in the following script tag from: -->
<!-- http://www.data-8.co.uk/integr8/Admin/Ajax.aspx -->
<script src="http://webservices.data-8.co.uk/Javascript/Loader.ashx?key=your-api-key" type="text/javascript">
</script>

<script type="text/javascript">

function loadIntegr8() {
  // Load the USTelephoneValidation Integr8 service
  data8.load('USTelephoneValidation');
}

function IsValid(number) {
  /// <param name="number">string</param>
  var ustelephonevalidation = new data8.ustelephonevalidation();
  
  ustelephonevalidation.isvalid(
    number,
    null,
    showIsValidResult
  );
}

function showIsValidResult(result) {
  // Check that the call succeeded, and show the error message if there was a problem.
  if (!result.Status.Success) {
    alert('Error: ' + result.Status.ErrorMessage);
  }
  else {
    // TODO: Process method results here.
    // Results can be extracted from the following fields:
    // result.Result
    //   Indicates if the telephone number is found to be valid.
  }
}

loadIntegr8();

</script>
Skip Navigation Links
Request handled by server S1 for client 38.107.179.217 at 23/05/2012 01:35:04