Service: GetPreferenceSubscriptions

Get all contact subscribe action to a preference

Service Details

SOAP Action: GetPreferenceSubscriptions
SOAP Return Object: GetPreferenceSubscriptionsResp

Input

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

Table: instance of GetPreferenceSubscriptionsReq

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 subscriptions for

Output

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

Table: instance of GetPreferenceSubscriptionsResp

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
subscriptions / Array of ActionlogType Array of action log types

Table: response codes of GetPreferenceSubscriptionsResp.

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

Example

Get all preference subscriptions for 2018, ordered 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("GetPreferenceSubscriptions", array($request));

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