Service: GetTemplates

The GetTemplates service allows you to retrieve a list of all personal templates within Flexmail.

Service Details

SOAP Action: GetTemplates
SOAP Return Object: GetTemplatesResp

Input

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

Table: instance of GetTemplatesReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication

Output

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

Table: instance of GetTemplatesResp

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
templateTypeItems / Array of TemplateType Array of all templates

Table: response codes of GetTemplatesResp.

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

Example

This example shows you how to get a list of all personal templates within Flexmail.

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

$getTemplatesReq->header = $header;

$getTemplatesReq->templateType = new stdClass();

$getTemplatesResp = $SoapClient->__soapCall("GetTemplates", array($getTemplatesReq));

if ($getTemplatesResp->errorCode == 0) {
	foreach ($getTemplatesResp->templateTypeItems as $templateType) {
		echo 	$templateType->templateId . " - " . $templateType->templateName;
	}
} else {
	echo "Get templates failed: " . $getTemplatesResp->errorMessage;
}
?>