The addHeaderFooters function allows you to add new reusable headers and footers that can be included at the top and bottom of messages.


writeResult = bApi.addHeaderFooters(headerFooterObject[] headerFooters)


Name Type Required Description
name string Yes The name assigned to the header/footer.
html string Yes The HTML version of the header.
text string Yes The text version of the header
isHeader boolean Yes Set to TRUE if the object is a header.

PHP Code Example

 * This script will add a header
 * @copyright  Copyright (c) 2011 Bronto Software (
$client = new SoapClient('', array('trace' => 1, 
                                 'features' => SOAP_SINGLE_ELEMENT_ARRAYS));
try {
  // Add your API token
  $token = "ADD API TOKEN";  
  print "logging in\n";
  $sessionId = $client->login(array('apiToken' => $token))->return;
  $session_header = new SoapHeader("",
                   array('sessionId' => $sessionId));
  // Add a header with some HTML and plain text content
  // isHeader should be set to false if you want to create
  // a footer.
  // Be sure to replace all place holder content with real
  // data.
  $headerFooterObject = array('name' => 'EXAMPLE HEADER NAME',
                 'html' => '<div>Header 
                       <span style="font-family: \'comic sans ms\', sans-serif; font-size: 14pt;" xml="lang">example</span> 
                 'text' => 'PLAIN TEXT CONTENT',
                 'isHeader' => true
  print "Adding the header\n";
  $write_result = $client->addHeaderFooters(array($headerFooterObject)
  // Note we are accessing the results and errors arrays.
  // Both of these arrays are returned as part of 
  // writeResult object.
  if ($write_result->errors) {
    print "There was a problem adding the header:\n";
  } else {
    print "The header has been added.  Id: " . $write_result->results[0]->id . "\n";
} catch (Exception $e) {
  print "uncaught exception\n";