Service: GetMailingLists

The GetMailingLists service allows you to get a list of all the mailing lists within a category.

Service Details

SOAP Action: GetMailingLists
SOAP Return Object: GetMailingListsResp

Input

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

Table: instance of GetMailingListsReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication
categoryId Y Integer Category id

Output

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

Table: instance of GetMailingListsResp

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
mailingListTypeItems / Array of MailingListType Array of all mailing lists

Table: response codes of GetMailingListsResp.

0 No error
220 Authentication error, see header object for detailed information

Example

This example shows you how to get a list of all mailing list items within a category with id 1234.

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

$getMailingListsReq->header = $header;
$getMailingListsReq->categoryId = 1234;
$getMailingListsResp = $SoapClient->__soapCall("GetMailingLists",array($getMailingListsReq));

if ($getMailingListsResp->errorCode == 0) {
	foreach ($getMailingListsResp->mailingListTypeItems as $mailingListType) {
		echo $mailingListType->mailingListId . " - " . $mailingListType->mailingListName;
	}
} else {
	echo "GetMailingLists failed: " . $getMailingListsResp->errorMessage;
}
?>