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.
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.
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>
// NOTE: A reference to the web service must be added in Visual Studio with the URL
// http://webservices.data-8.co.uk/MobileValidation.asmx
private void IsValid(string number)
{
// Invoke the web service method.
MobileValidation proxy = new MobileValidation();
MobileValidationOutput results = proxy.IsValid("username", "password", number, null);
// Check that the call succeeded, and show the error message if there was a problem.
if ((results.Status.Success == false))
{
MessageBox.Show(("Error: " + results.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.
}
}
'NOTE: A reference to the web service must be added in Visual Studio with the URL
'http://webservices.data-8.co.uk/MobileValidation.asmx
Private Sub IsValid(ByVal number As String)
'Invoke the web service method.
Dim proxy As MobileValidation = New MobileValidation()
Dim results As MobileValidationOutput = proxy.IsValid("username", "password", number, Nothing)
'Check that the call succeeded, and show the error message if there was a problem.
If (results.Status.Success Is false) Then
MessageBox.Show(("Error: " + results.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.
End If
End Sub
Public Sub IsValid(number As String)
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "http://webservices.data-8.co.uk/recordset.ashx?service=MobileValidation&method=IsValidSimple" &
"&username=your-username" &
"&password=your-password" &
"&number=" & number
If rs.MoveFirst Then
If rs.Fields(0).Name = "Success" And rs.Fields(0).Value = false Then
MsgBox "Error: " & rs.Fields(1)
Else
'TODO: Process method results here.
'All the results are available in the first row in the recordset.
'Results can be extracted from the following fields:
'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).
'CountryISO
' The ISO of the country the mobile telephone originates from.
'Organisation
' The organisation which the mobile telephone originates from.
'NetworkName
' The network which the mobile telephone originates from.
'NetworkType
' The type of mobile network the mobile telephone originates from.
'Ported
' Whether the mobile telephone is ported.
'PortedFromOrganisation
' If the number is ported, the organisation the mobile telephone has been ported from.
'PortedFromNetwork
' If the number is ported, the network the mobile telephone has been ported from.
'LocationISO
' The country ISO that the mobile is currently located in.
End If
End If
End Sub
// NOTE: The php_soap.dll extension must be enabled in the php.ini file.
function IsValid($number)
{
$params = array(
"username" => "your-username",
"password" => "your-password",
"number" => $number,
"options" => $options
);
$client = new SoapClient("http://webservices.data-8.co.uk/MobileValidation.asmx?WSDL");
$result = $client->IsValid($params);
if ($result->IsValidResult->Status->Success == 0)
{
echo "Error: " . $result->IsValidResult->Status->ErrorMessage;
}
else
{
// TODO: Process method results here.
// Results can be extracted from the following fields:
// $result->IsValidResult->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->IsValidResult->CountryISO
// The ISO of the country the mobile telephone originates from.
// $result->IsValidResult->Organisation
// The organisation which the mobile telephone originates from.
// $result->IsValidResult->NetworkName
// The network which the mobile telephone originates from.
// $result->IsValidResult->NetworkType
// The type of mobile network the mobile telephone originates from.
// $result->IsValidResult->Ported
// Whether the mobile telephone is ported.
// $result->IsValidResult->PortedFromOrganisation
// If the number is ported, the organisation the mobile telephone has been ported from.
// $result->IsValidResult->PortedFromNetwork
// If the number is ported, the network the mobile telephone has been ported from.
// $result->IsValidResult->LocationISO
// The country ISO that the mobile is currently located in.
}
}