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