Service: GetPreferences

The getPreferences service allows you to retrieve a list of all personal preferences within Flexmail.

Service Details

SOAP Action: GetPreferences
SOAP Return Object: GetPreferencesResp

Input

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

Table: instance of GetPreferencesReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication

Output

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

Table: instance of GetPreferencesResp

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
preferenceTypeItems / Array of PreferenceType Array of all preferences

Table: response codes of GetPreferencesResp.

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

Example

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

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

$getPreferencesReq->header = $header;
$getPreferencesResp = $SoapClient->__soapCall("GetPreferences", array($getPreferencesReq));

if ($getPreferencesResp->errorCode == 0) {
	foreach ($getPreferencesResp->preferenceTypeItems as $preferenceType) {
		echo $preferenceType->preferenceId . " - " . $preferenceType->preferenceName;
	}
} else {
	echo "Get preference failed: " . $getPreferencesResp->errorMessage;
}
?>