The readFields function attempts to return fields that match all of the given filter. The specified attributes of the fields are returned for each matching field.


The readFields function may return 1 or many field objects. See the documentation on the fieldObject for a list of the data fields that could potentially be returned.

Note: The data fields returned depend on the type of data you ask for in your request.


fieldObject[] fields = bApi.readFields(filter fieldsFilter, pageNumber);


Name Type Required Comments
filter fieldsFilter Yes The filter used to return only specific fields.
pageNumber int Yes Retrieves the next “batch” of objects as the value specified increases from 1. In order to obtain an entire set of objects for a given call, you should increase the number value assigned to pageNumber until no more objects are returned.
pageSize int No Allows you to set a limit for the page size in order to improve performance speed. If set, the pageSize minimum is 10 and the maximum is 5,000.

PHP Code Example

 * This example will read the details of any fields in your account that have
 * the name 'name' in them (example: firstname, lastname).
$client = new SoapClient('', array('trace' => 1, 
                                 'features' => SOAP_SINGLE_ELEMENT_ARRAYS));
try {
  $token = "YOUR_TOKEN_HERE";
  print "logging in\n";
  $sessionId = $client->login(array('apiToken' => $token))->return;
  $session_header = new SoapHeader("",
                   array('sessionId' => $sessionId));
  // filter on fields that contain 'name'
  $filter = array('name' => array('operator' => 'Contains',
                  'value' => 'name',
  print "reading all fields that contain the string 'name'\n";
  $fields = $client->readFields(array('pageNumber' => 1,
                    'filter' => $filter,
  // print matching results
  foreach ($fields as $field) {
    print "Field name: " . $field->name . "; type: " . $field->type . "\n";
} catch (Exception $e) {
  print "uncaught exception\n";