Did you know you can now create headers and footers using the API instead of logging into the Bronto application? As part of the new API, we have introduced a function called addHeaderFooters.
This new function, and its associated functions deleteHeaderFooters, readHeaderFooters and updateHeaderFooters, allows you to manipulate the name and contents of your headers and footers from outside the Bronto application. The arguments are name, html, text and isHeader. These allow you to specify the name of the header or footer, the html and plain text content of the header or footer, and how it should be used.
Do you design your headers and footers in an external application and then log into Bronto to create your header and paste in your content? Using these four functions, you can create, modify, read, and delete headers and footers from an external, customized application. Now you can avoid the process of cutting and pasting your content into Bronto by sending a SOAP message like this
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v4="http://api.bronto.com/v4">
<soapenv:Header>
<v4:sessionHeader>
<sessionId>840ae3a0-2e4f-478e-bc54-0f2e9bebce26</sessionId>
</v4:sessionHeader>
</soapenv:Header>
<soapenv:Body>
<v4:addHeaderFooters>
<footers>
<name>Header Created using the API</name>
<html>This is the <b>HTML content</b> of the new header</html>
<text>This is the Text content of the new header</text>
<isHeader>true</isHeader>
</footers>
</v4:addHeaderFooters>
</soapenv:Body>
</soapenv:Envelope>
Here is some sample PHP code to generate this SOAP message:
$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));
$html = 'This is the >b>HTML content>/b> of the new header';
$text = 'This is the Text content of the new header';
$header = array('name' => 'Header Created using the API',
'html' => $html,
'text' => $text,
'isHeader' => 'true');
$res = $client->addHeaderFooters(array($header))->return;
If you have any questions, feel free to leave them in the comments section below.
Andrew Kanes
Support Engineer at Bronto
Related posts:
- Agencies Can Create New Accounts Using The API Last month we discussed how to create headers and footers...
- Clear that List using the API v4 Last fall, Alex explained how to Clear Contacts From...
- Adding Contact Fields using the API Recently, we wrote about creating headers and footers and adding...
{ 2 trackbacks }
{ 0 comments… add one now }