Service: GetCustomFields

The GetCustomFields service allows you to retrieve a list of all custom fields for an account.

Service Details

SOAP Action: GetCustomFields
SOAP Return Object: GetCustomFieldsResp

Input

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

Table: instance of GetCustomFieldsReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication

Output

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

Table: instance of GetCustomFieldsResp

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
customFields / Array of CustomFieldsFieldType List of custom fields

Table: response codes of GetCustomFieldsResp.

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

Example

Get a list of all custom fields in an account

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

$getCustomFieldsReq->header = $header;
$getCustomFieldsResp = $SoapClient->__soapCall("GetCustomFields", array($getCustomFieldsReq));

if ($getCustomFieldsResp->errorCode == 0) {
	foreach ($getCustomFieldsResp->customFields as $field) {
		echo $field->id . " - " . $field->label . " - " . $field->type;
	}
} else {
	echo "GetCustomFields failed: " . $getCustomFieldsResp->errorMessage;
}
?>