Service: GetMessages

The GetMessages service allows you to list of all the messages within a category.

Service Details

SOAP Action: GetMessages
SOAP Return Object: GetMessagesResp

Input

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

Table: instance of GetMessagesReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication
archived / Boolean Get all archived messages, default: false
metaDataOnly / Boolean Return only the messages meta data, omit text/content
optin / Boolean Get all optin messages, default: false

Output

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

Table: instance of GetMessagesResp

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
messageTypeItems / Array of MessageType Array of all Messages

Table: response codes of GetMessagesResp.

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

Example

This example shows you the deletion of a category with id 1234.

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

$getMessagesReq->header = $header;

$getMessagesResp = $SoapClient->__soapCall("GetMessages", array($getMessagesReq));

if ($getMessagesResp->errorCode == 0) {
	foreach ($getMessagesResp->messageTypeItems as $messageType) {
		echo $messageType->messageId . " - " . $messageType->messageName
	}
} else {
	echo "GetMailingLists failed: " . $getMessagesResp->errorMessage;
}
?>