The GetTemplates service allows you to retrieve a list of all personal templates within Flexmail.
SOAP Action: GetTemplates
SOAP Return Object: GetTemplatesResp
The following table describes the parameters used for calling the GetTemplates service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
The following table describes the parameters returned from the GetTemplates service.
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 |
0 | No error |
---|---|
220 | Authentication error, see header object for detailed information |
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; } ?>