IsValid
 

IsValid

Definition

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

Description:

Checks a mobile telephone nuber for validity and returns some information about the subscriber.

If the telephone number is not supplied in full international format, the service will assume it is a UK number by default. This can be overridden by supplying an appropriate value for the DefaultCountryCode option.

This service is not appropriate if you require indication about any number other than a mobile number. In those circumstances, you should consider the use of the telephone validation service or North America telephone validation service.

Note that cellphone numbers within North America are validated only to the extent provided by the North America telephone validation service due to technical restrictions within the mobile network.

Options:

DefaultCountryCode
Sets the international dialling code prefix to use by default for any numbers given in local format, e.g. "1" for North America, "49" for Germany etc.

View all Mobile 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 MobileValidation Integr8 service
  data8.load('MobileValidation');
}

function IsValid(number) {
  /// <param name="number">string</param>
  var mobilevalidation = new data8.mobilevalidation();
  
  mobilevalidation.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
    //   The status of the mobile telephone number query, either Success (subscriber available), Unavailable (subscriber has a temporary error), Invalid (subscriber has a permanent error), TimedOut (the query did not return within the time) or Error (an unknown error occurred).
    // result.CountryISO
    //   The ISO of the country the mobile telephone originates from.
    // result.Organisation
    //   The organisation which the mobile telephone originates from.
    // result.NetworkName
    //   The network which the mobile telephone originates from.
    // result.NetworkType
    //   The type of mobile network the mobile telephone originates from.
    // result.Ported
    //   Whether the mobile telephone is ported.
    // result.PortedFromOrganisation
    //   If the number is ported, the organisation the mobile telephone has been ported from.
    // result.PortedFromNetwork
    //   If the number is ported, the network the mobile telephone has been ported from.
    // result.LocationISO
    //   The country ISO that the mobile is currently located in.
  }
}

loadIntegr8();

</script>
Skip Navigation Links
Request handled by server S1 for client 38.107.179.218 at 22/05/2012 23:23:53