Service: GetGroupSubscriptions

Note: Groups are called Interest Labels in the GUI

Get all contact group subscriptions

Service Details

SOAP Action: GetGroupSubscriptions
SOAP Return Object: GetGroupSubscriptionsResp

Input

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

Table: instance of GetGroupSubscriptionsReq

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
groupId / Integer The group id to get subscriptions for

Output

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

Table: instance of GetGroupSubscriptionsResp

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

Table: response codes of GetGroupSubscriptionsResp.

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

Example

Get all group subscriptions 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->groupId = 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("GetGroupSubscriptions", array($request));

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

?>