Checks a mobile telephone number 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 InternationalTelephoneValidation service.
Note that cellphone numbers within North America are validated only to the extent provided by the international telephone validation service due to technical restrictions within the mobile network.
Parameters
The following parameters can be supplied to this method
username
username
See the available authentication methods. If you are
using username & password authentication,
specify the username to authenticate as. If you are using
API Key authentication and you are not using
the JSON, Javascript or ADO APIs, use your API Key here with the prefix apikey-, e.g.
apikey-ABCD-1234-EFGH-5678
An array of options that control further details of how this method operates. See the Advanced Options section below for more information.
Advanced Options
The following options can be specified as part of the option parameter. Each option is specified
as a key/value pair. The list of available names is shown below, along with a description of the allowable values
for that name.
DefaultCountryCode
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.
AllowedPrefixes
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 "+447" to allow only standard UK mobile numbers.
BarredPrefixes
BarredPrefixes
A comma-separated list of prefixes in standard international format that will cause the number to be treated as invalid. For example, use "+90,+447781" to block any Indian numbers or numbers allocated to C&W Guernsey.
Results
This method returns an object containing the following fields:
Status
Status
Indicates whether the method call was successful, or if some error occurred.
If the Success field is true, the other results described below can be used to get the results of the method.
If Success is false, some error occurred in calling the method, such as the authentication failed or the
account is out of credits. The details of the error can be obtained from the ErrorMessage field, and any other results should be ignored
Result
Result
The status of the mobile telephone number query. This can be one of the following values:
Success - subscriber available
Unavailable - subscriber has a temporary error
Invalid - subscriber has a permanent error
TimedOut - the query did not return within the time
Error - an unknown error occurred
In general, Success means the number will ring/receive a text message, Unavailable indicates the number is valid but the phone is switched off or out of reception, while Invalid means the number is not allocated
CountryISO
CountryISO
The ISO 3-character code of the country the mobile telephone originates from
Organisation
Organisation
The telco the telephone is registered with
NetworkName
NetworkName
The network which the telephone is registered to
NetworkType
NetworkType
The type of network the telephone is registered to. NB: This property is not always populated.
Ported
Ported
Indicates if the telephone has been ported between networks
PortedFromOrganisation
PortedFromOrganisation
If the number has been ported, indicates the organisation the telephone was originally registered with
PortedFromNetwork
PortedFromNetwork
If the number is ported, indicates the network the telephone was originally registered to
LocationISO
LocationISO
The ISO 3-character country code that the mobile is currently located in
Live Demo
number
options
Name
Value
Credits Remaining Today:
Live Demo Results
We hope you like our service! Sign up for a free account and start using our full range of products today.
Sample Code
<!-- Import the Integr8 Ajax API --><!-- NOTE: Get your own API key to use in the following script tag from: --><!-- https://www.data-8.co.uk/ValidationAdmin/AjaxAPIKey --><scripttype="text/javascript"src="https://webservices.data-8.co.uk/Javascript/Loader.ashx?key=your-api-key&load=MobileValidation"></script><scripttype="text/javascript">function IsValid(number) {
/// <param name="number">string</param>var mobilevalidation = new data8.mobilevalidation();
mobilevalidation.isvalid(
number,
[
new data8.option('DefaultCountryCode', '44'),
new data8.option('AllowedPrefixes', ''),
new data8.option('BarredPrefixes', '')
],
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.
}
}
</script>
// NOTE: A Service Reference to the web service must be added to use this sample code.privatevoid IsValid(string number)
{
// Declare the required options.
Option DefaultCountryCode = new Option();
DefaultCountryCode.Name = "DefaultCountryCode";
DefaultCountryCode.Value = "44";
Option AllowedPrefixes = new Option();
AllowedPrefixes.Name = "AllowedPrefixes";
AllowedPrefixes.Value = "";
Option BarredPrefixes = new Option();
BarredPrefixes.Name = "BarredPrefixes";
BarredPrefixes.Value = "";
// Invoke the web service method.
MobileValidationSoapClient proxy = new MobileValidationSoapClient();
MobileValidationOutput results = proxy.IsValid("your-username", "your-password", number, new Option[] {
DefaultCountryCode,
AllowedPrefixes,
BarredPrefixes});
// 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 Service Reference to the web service must be added to use this sample code.PrivateSub IsValid(ByVal number AsString)
'Declare the required options.Dim DefaultCountryCode As [Option] = New [Option]()
DefaultCountryCode.Name = "DefaultCountryCode"
DefaultCountryCode.Value = "44"Dim AllowedPrefixes As [Option] = New [Option]()
AllowedPrefixes.Name = "AllowedPrefixes"
AllowedPrefixes.Value = ""Dim BarredPrefixes As [Option] = New [Option]()
BarredPrefixes.Name = "BarredPrefixes"
BarredPrefixes.Value = ""'Invoke the web service method.Dim proxy As MobileValidationSoapClient = New MobileValidationSoapClient()
Dim results As MobileValidationOutput = proxy.IsValid("your-username", "your-password", number, New [Option]() {DefaultCountryCode, AllowedPrefixes, BarredPrefixes})
'Check that the call succeeded, and show the error message if there was a problem.If (results.Status.Success = 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.EndIfEndSub
// NOTE: The php_soap.dll extension must be enabled in the php.ini file.function IsValid($number)
{
$options = array(
"Option" => array(
array(
"Name" => "DefaultCountryCode",
"Value" => "44"
),
array(
"Name" => "AllowedPrefixes",
"Value" => ""
),
array(
"Name" => "BarredPrefixes",
"Value" => ""
)
)
);
$params = array(
"username" => "your-username",
"password" => "your-password",
"number" => $number,
"options" => $options
);
$client = new SoapClient("https://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.
}
}
Post the request to https://webservices.data-8.co.uk/MobileValidation/IsValid.json?key=your-api-key
and do NOT include the username or password properties in the request JSON document.
Post the request to https://webservices.data-8.co.uk/MobileValidation/IsValid.json
and include username and password properties in the request JSON document.
Do not use for client-side requests!
Obtain a JWT token for your user and post the request to https://webservices.data-8.co.uk/MobileValidation/IsValid.json
Include the JWT token in the request headers as: Authorization: Bearer your-jwt-token
PublicSub IsValid(number AsString)
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "https://webservices.data-8.co.uk/recordset.ashx?service=MobileValidation&method=IsValidSimple" &
"&username=your-username" &
"&password=your-password" &
"&number=" & number
If rs.MoveFirst ThenIf rs.Fields(0).Name = "Success"And rs.Fields(0).Value = falseThen
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.EndIfEndIfEndSub