Finds the first number from the list supplied that is callable, i.e. is not registered on the TPS. This is useful if you have more than one number for a person and want to check which number you can contact them on.
Each telephone number that needs to be searched against the TPS results in an extra charge on your account for the appropriate number of credits for a TPS search. If you supply two telephone numbers and the first one is callable, you will only be
charged for one TPS lookup as we never have to look up the second one. However, if the first number is not callable you will be charged for two TPS searches as we have to search for both numbers against the TPS.
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 TPS Integr8 service
data8.load('TPS');
}
function GetCallableNumber(numbers) {
/// <param name="numbers">string[]</param>
var tps = new data8.tps();
tps.getcallablenumber(
numbers,
null,
showGetCallableNumberResult
);
}
function showGetCallableNumberResult(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.Callable
// Indicates if the telphone number is callable (i.e. not on the TPS)
// result.TelephoneNumber
// Contains the original telephone number if it is callable.
}
}
loadIntegr8();
</script>
// NOTE: A reference to the web service must be added in Visual Studio with the URL
// http://webservices.data-8.co.uk/TPS.asmx
private void GetCallableNumber(string[] numbers)
{
// Invoke the web service method.
TPS proxy = new TPS();
TPSOutput results = proxy.GetCallableNumber("username", "password", numbers, 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.Callable
// Indicates if the telphone number is callable (i.e. not on the TPS)
// result.TelephoneNumber
// Contains the original telephone number if it is callable.
}
}
'NOTE: A reference to the web service must be added in Visual Studio with the URL
'http://webservices.data-8.co.uk/TPS.asmx
Private Sub GetCallableNumber(ByVal numbers() As String)
'Invoke the web service method.
Dim proxy As TPS = New TPS()
Dim results As TPSOutput = proxy.GetCallableNumber("username", "password", numbers, 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.Callable
' Indicates if the telphone number is callable (i.e. not on the TPS)
'result.TelephoneNumber
' Contains the original telephone number if it is callable.
End If
End Sub
Public Sub GetCallableNumber(numbers As String)
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "http://webservices.data-8.co.uk/recordset.ashx?service=TPS&method=GetCallableNumberSimple" &
"&username=your-username" &
"&password=your-password" &
"&numbers=" & numbers
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:
'Callable
' Indicates if the telphone number is callable (i.e. not on the TPS)
'TelephoneNumber
' Contains the original telephone number if it is callable.
End If
End If
End Sub
// NOTE: The php_soap.dll extension must be enabled in the php.ini file.
function GetCallableNumber($numbers)
{
$params = array(
"username" => "your-username",
"password" => "your-password",
"numbers" => $numbers,
"options" => $options
);
$client = new SoapClient("http://webservices.data-8.co.uk/TPS.asmx?WSDL");
$result = $client->GetCallableNumber($params);
if ($result->GetCallableNumberResult->Status->Success == 0)
{
echo "Error: " . $result->GetCallableNumberResult->Status->ErrorMessage;
}
else
{
// TODO: Process method results here.
// Results can be extracted from the following fields:
// $result->GetCallableNumberResult->Callable
// Indicates if the telphone number is callable (i.e. not on the TPS)
// $result->GetCallableNumberResult->TelephoneNumber
// Contains the original telephone number if it is callable.
}
}