Checks if the person given in the input record is registered with the MPS, and so does not wish to receive marketing by direct mail. If they are willing to receive direct mail, the service returns true. If not, the service returns false.
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 MPS Integr8 service
data8.load('MPS');
}
function IsMailable(record) {
/// <param name="record">data8.inputrecord. Set up the Name, Address properties before calling this method.</param>
var mps = new data8.mps();
mps.ismailable(
record,
null,
showIsMailableResult
);
}
function showIsMailableResult(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.Mailable
// Indicates if the person has been found to be on the MPS.
}
}
loadIntegr8();
</script>
// NOTE: A reference to the web service must be added in Visual Studio with the URL
// http://webservices.data-8.co.uk/MPS.asmx
private void IsMailable(InputRecord record)
{
// Invoke the web service method.
MPS proxy = new MPS();
MPSOutput results = proxy.IsMailable("username", "password", record, 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.Mailable
// Indicates if the person has been found to be on the MPS.
}
}
'NOTE: A reference to the web service must be added in Visual Studio with the URL
'http://webservices.data-8.co.uk/MPS.asmx
Private Sub IsMailable(ByVal record As InputRecord)
'Invoke the web service method.
Dim proxy As MPS = New MPS()
Dim results As MPSOutput = proxy.IsMailable("username", "password", record, 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.Mailable
' Indicates if the person has been found to be on the MPS.
End If
End Sub
Public Sub IsMailable(title As String, forename As String, middleName As String, surname As String, address As String)
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "http://webservices.data-8.co.uk/recordset.ashx?service=MPS&method=IsMailableSimple" &
"&username=your-username" &
"&password=your-password" &
"&title=" & title &
"&forename=" & forename &
"&middleName=" & middleName &
"&surname=" & surname &
"&address=" & address
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:
'Mailable
' Indicates if the person has been found to be on the MPS.
End If
End If
End Sub
// NOTE: The php_soap.dll extension must be enabled in the php.ini file.
function IsMailable($record)
{
$params = array(
"username" => "your-username",
"password" => "your-password",
"record" => $record,
"options" => $options
);
$client = new SoapClient("http://webservices.data-8.co.uk/MPS.asmx?WSDL");
$result = $client->IsMailable($params);
if ($result->IsMailableResult->Status->Success == 0)
{
echo "Error: " . $result->IsMailableResult->Status->ErrorMessage;
}
else
{
// TODO: Process method results here.
// Results can be extracted from the following fields:
// $result->IsMailableResult->Mailable
// Indicates if the person has been found to be on the MPS.
}
}