Service: GetPreferenceUnsubscriptions

Get all contact preference unsubscriptions

Service Details

SOAP Action: GetPreferenceUnsubscriptions
SOAP Return Object: GetPreferenceUnsubscriptionsResp

Input

The following table describes the parameters used for calling the GetPreferenceUnsubscriptions service.

Table: instance of GetPreferenceUnsubscriptionsReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication
from / DateTime Get actions starting from this date
till / DateTime Get action up untill this time
limit / Pagination Limit the response to x items per page, request a certain page
order / Ordening Order by: Timestamp or EmailAddress
preferenceId / Integer The preference id to get unsubscriptions for

Output

The following table describes the parameters returned from the GetPreferenceUnsubscriptions service.

Table: instance of GetPreferenceUnsubscriptionsResp

Parameter Mandatory Type Description
header / APIResponseHeader Header containing authentication information
errorCode / Integer Numerical value of the error
errorMessage / String Short literal description of the error
unsubscriptions / ActionlogType Array of action log types

Table: response codes of GetPreferenceUnsubscriptionsResp.

0 No error
220 Authentication error, see header object for detailed information
221 PreferenceId is mandatory

Example

Get all preference unsubscriptions for 2018 order from most recent to least recent limited to 100 items, get page 3

<?php

// create header object
$header = new stdClass();
$header->userId = USER_ID;
$header->userToken = USER_TOKEN;

// build request
$request = new stdClass();
$request->header = $header;
$request->preferenceId = 33;

// limit to 100 items per request get page 3
$request->limit = new stdClass();
$request->limit->items = 100;
$request->limit->page = 3;

// order descending by timestamp
$request->order = new stdClass();
$request->order->orderBy = 'Timestamp';
$request->order->orderDirection = 'DESC';


// limit to year 2018
$request->from = "2018-01-01T00:00:01";
$request->till = "2018-12-31T23:59:59";

$response = $SoapClient->__soapCall("GetPreferenceUnsubscriptions", array($request));

if ($response->errorCode == 0) {
	print_r($response);
} else {
	echo "Could not get preference unsubscriptons" . $response->errorMessage;
}

?>