The service returns a code indicating the status of the telephone number. This code can be one of the following values:
Valid - the telephone number is valid
Invalid - the telephone number is invalid
TemporaryInvalid - the telephone number is invalid, but may become valid shortly
Ambiguous - we got a response from the telephone network that can indicate either a valid or invalid number
NumberChanged - the telephone number is invalid, but calling it will give you a recording telling you a new number
Unknown - we could not determine the validity of the number
Error - an error occurred communicating with the telephone network
TimedOut - we did not get a response from the telephone network in a timely manner
In normal circumstances you should only receive the first four status codes. If you receive one of the final three status codes, we will investigate the cause and attempt to ensure it does not happen again, and you will not be charged for the query.
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.
Options:
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 UK 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 "+4470,+449" to block any personal non-geographic or premium rate numbers.
<!-- 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 TelephoneLineValidation Integr8 service
data8.load('TelephoneLineValidation');
}
function IsValid(number) {
/// <param name="number">string</param>
var telephonelinevalidation = new data8.telephonelinevalidation();
telephonelinevalidation.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>
// NOTE: A reference to the web service must be added to use this sample code.
// See the details at:
// https://www.data-8.co.uk/developers/how-to/-net-1-0-1-1-and-2-0-web-references
// or
// https://www.data-8.co.uk/developers/how-to/-net-3-5-and-later-service-references
private void IsValid(string number)
{
// Invoke the web service method.
TelephoneLineValidationSoapClient proxy = new TelephoneLineValidationSoapClient();
TelephoneLineValidationOutput 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
// Indicates if the telephone number is found to be valid.
}
}
'NOTE: A reference to the web service must be added to use this sample code.
'See the details at:
'https://www.data-8.co.uk/developers/how-to/-net-1-0-1-1-and-2-0-web-references
'or
'https://www.data-8.co.uk/developers/how-to/-net-3-5-and-later-service-references
Private Sub IsValid(ByVal number As String)
'Invoke the web service method.
Dim proxy As TelephoneLineValidationSoapClient = New TelephoneLineValidationSoapClient()
Dim results As TelephoneLineValidationOutput = 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 = false) Then
MessageBox.Show(("Error: " + results.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.
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("https://webservices.data-8.co.uk/TelephoneLineValidation.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
// Indicates if the telephone number is found to be valid.
}
}
Post requests to the JSON endpoint: https://webservices.data-8.co.uk/TelephoneLineValidation/IsValid.json
Requests can be authenticated in any of three ways:
API Key - include the key on the URL as ?key=your-ajax-api-key query string
JWT token - acquire a JWT token from the GetJWT method on the UserAdmin service and include it in a Authorization: Bearer your-jwt-token HTTP header
Username & password - include your Data8 username and password as additional properties in the JSON request body
Public Sub IsValid(number As String)
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "https://webservices.data-8.co.uk/recordset.ashx?service=TelephoneLineValidation&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
' Indicates if the telephone number is found to be valid.
End If
End If
End Sub