The GetCustomFields service allows you to retrieve a list of all custom fields for an account.
SOAP Action: GetCustomFields
SOAP Return Object: GetCustomFieldsResp
The following table describes the parameters used for calling the GetCustomFields service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
The following table describes the parameters returned from the GetCustomFields 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 |
customFields | / | Array of CustomFieldsFieldType | List of custom fields |
0 | No error |
---|---|
220 | Authentication error, see header object for detailed information |
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; } ?>