readHeaderFooters
The readHeaderFooters
function attempts to return headers or footers that match the given filter. Header or footer objects can optionally include the associated HTML content.
Results
The readHeaderFooters
function may return 1 or many header/footer objects.
See the documentation on the headerFooterObject
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.
Syntax
headerFooterObject[] headerFooters = bApi.readHeaderFooters(filter headerFooterFilter, includeContent, pageNumber);
Parameters
Name | Type | Required | Comments |
---|---|---|---|
filter |
headerFooterFilter | Yes | The filter used to return specific headers or footers. |
includeContent |
boolean | Yes | Include the HTML portion of returned footers. |
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. |
PHP Code Example
<?php /** * This example will read a list of all available headers and then all available * footers in your account. It will print the name and the id of each. */ $client = new SoapClient('https://api.bronto.com/v4?wsdl', 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("http://api.bronto.com/v4", 'sessionHeader', array('sessionId' => $sessionId)); $client->__setSoapHeaders(array($session_header)); // get only headers $filter = array('position' => 'top'); print "reading all headers\n"; $headers = $client->readHeaderFooters(array('pageNumber' => 1, 'includeContent' => false, 'filter' => $filter, ) )->return; // print matching results foreach ($headers as $header) { print "Header name: " . $header->name . "; id: " . $header->id . "\n"; } print "\n"; // get only footers $filter = array('position' => 'bottom'); print "reading all footers\n"; $headers = $client->readHeaderFooters(array('pageNumber' => 1, 'includeContent' => false, 'filter' => $filter, ) )->return; // print matching results foreach ($headers as $header) { print "Footer name: " . $header->name . "; id: " . $header->id . "\n"; } } catch (Exception $e) { print "uncaught exception\n"; print_r($e); }