Service: GetSubscriptions

The GetSubscriptions service allows you to recall subscribed email addresses. Subscribed email addresses can be recalled by mailing list and timestamp.

Service Details

SOAP Action: GetSubscriptions
SOAP Return Object: GetSubscriptionsResp

Input

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

Table: instance of GetSubscriptionsReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication
mailingListId / Integer Mailing list id
timestampSince / String Timestamp that marks the beginning of the searchable period

Output

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

Table: instance of GetSubscriptionsResp

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
subscriptionTypeItems / Array of SubscriptionType Array of subscriptionsType items

Table: response codes of GetSubscriptionsResp.

0 No error
220 Authentication error, see header object for detailed information
221 Mailing list id is invalid
222 Invalid timestamp

Example

This examples show the request of all email addresses that unsubscribed for campaign 222.

<?php
$header->userId = USER_ID;
$header->userToken = USER_TOKEN;

$getSubscriptionsReq->header = $header;
$getSubscriptionsReq->mailingListId = 2021;

$getSubscriptionsResp = $SoapClient->__soapCall("GetSubscriptions", array($getSubscriptionsReq));

if ($getSubscriptionsResp->errorCode == 0) {
	// Handle return list of Subscriptions.
} else {
	echo "Subscriptions could not be retrieved: " . $getSubscriptionsResp->errorMessage;
}
?>