0151 355 4555

IsValid

Description

Checks a 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 within a range of numbers that have been allocated for use.

This service is not appropriate if you require an absolute indication that a telephone number is valid for a particular individual. In those circumstances, you should consider the use of a telephone number capture service. However, this service does provide a quick and inexpensive method for preventing accidentally mis-typed numbers.

Options:

UseMobileValidation
If set to true then the service will use MobileValidation on any number it recognises as a mobile number and TelephoneValidation on all other numbers. Any validation call will be debited either a TelephoneValidation credit or a MobileValidation credit accordingly so please ensure you have MobileValidation credits available before using this option. The option defaults to false.

UseLineValidation
If set to true then the service will use LandlineValidation on any number it recognises as a landline number and TelephoneValidation on all other numbers. Any validation call will be debited either a TelephoneValidation credit or a LandlineValidation credit accordingly so please ensure you have LandlineValidation credits available before using this option. The option defaults to false.

IgnoreExtraDigits
Treats a number as valid even if it is too long. For example, dialling "0151 355 4555 1" will actually call the number "0151 355 4555". With this option set to true, the service will indicate that "0151 355 4555 1" is a valid number, otherwise it will not.

AllowedPrefixes
A comma-separated list of prefixes in standard international format that the number must start with to be treated as valid. For example, use "+441,+442" to allow only standard landline numbers.

BarredPrefixes
A comma-separated list of prefixes in standard international format that will cause the number to be treated as invalid. For example, use "+449" to block any premium rate numbers.

View all Telephone Validation (UK) methods

Code Samples

<!-- 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="https://webservices.data-8.co.uk/Javascript/Loader.ashx?key=your-api-key" type="text/javascript">
</script>

<script type="text/javascript">

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

function IsValid(number) {
  /// <param name="number">string</param>
  var telephonevalidation = new data8.telephonevalidation();
  
  telephonevalidation.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>