Finds the first number from the list supplied that is callable, i.e. is not registered on the CTPS. 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 CTPS results in an extra charge on your account for the appropriate number of credits for a CTPS search. If you supply two telephone numbers and the first one is callable, you will only be
charged for one CTPS 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 CTPS searches as we have to search for both numbers against the CTPS.
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 CTPS Integr8 service
data8.load('CTPS');
}
function GetCallableNumber(numbers) {
/// <param name="numbers">string[]</param>
var ctps = new data8.ctps();
ctps.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 supplied telephone number is callable (i.e. not on the CTPS)
// 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/CTPS.asmx
private void GetCallableNumber(string[] numbers)
{
// Invoke the web service method.
CTPS proxy = new CTPS();
CTPSOutput 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 supplied telephone number is callable (i.e. not on the CTPS)
// 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/CTPS.asmx
Private Sub GetCallableNumber(ByVal numbers() As String)
'Invoke the web service method.
Dim proxy As CTPS = New CTPS()
Dim results As CTPSOutput = 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 supplied telephone number is callable (i.e. not on the CTPS)
'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=CTPS&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 supplied telephone number is callable (i.e. not on the CTPS)
'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/CTPS.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 supplied telephone number is callable (i.e. not on the CTPS)
// $result->GetCallableNumberResult->TelephoneNumber
// Contains the original telephone number if it is callable.
}
}