<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Brontoversity &#187; Andrew Kanes</title>
	<atom:link href="http://brontoversity.com/author/andrew/feed/" rel="self" type="application/rss+xml" />
	<link>http://brontoversity.com</link>
	<description>Product Education for Bronto's Email Marketing Application</description>
	<lastBuildDate>Tue, 07 Sep 2010 18:07:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adding Contact Fields using the API</title>
		<link>http://brontoversity.com/2010/08/19/adding-contact-fields-using-the-api/</link>
		<comments>http://brontoversity.com/2010/08/19/adding-contact-fields-using-the-api/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 18:08:46 +0000</pubDate>
		<dc:creator>Andrew Kanes</dc:creator>
				<category><![CDATA[API Version 4]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[Did You Know?]]></category>
		<category><![CDATA[API version 4]]></category>
		<category><![CDATA[Contact Fields]]></category>

		<guid isPermaLink="false">http://brontoversity.com/?p=8429</guid>
		<description><![CDATA[Recently, we wrote about creating headers and footers and adding new users using the API so that you can update your Bronto account without actually logging into the Bronto application.  We wanted to let you know that can also create contact fields using the API.  These fields allow you to store additional information about your [...]


Related posts:<ol><li><a href='http://brontoversity.com/2010/07/22/clear-that-list-using-the-api-v4/' rel='bookmark' title='Permanent Link: Clear that List using the API v4'>Clear that List using the API v4</a> <small> Last fall, Alex explained how to Clear Contacts From...</small></li>
<li><a href='http://brontoversity.com/2010/04/29/create-a-header-without-logging-into-bronto/' rel='bookmark' title='Permanent Link: Create a Header Without Logging into Bronto'>Create a Header Without Logging into Bronto</a> <small>Did you know you can now create headers and footers...</small></li>
<li><a href='http://brontoversity.com/2010/08/13/the-pluses-and-minuses/' rel='bookmark' title='Permanent Link: The Pluses And Minuses Of List Management'>The Pluses And Minuses Of List Management</a> <small>What happened to all my lists?!?!? You might be asking...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://brontoversity.com/wp-content/uploads/2010/08/2179082201_8d52cffb60.jpg"><img style="padding: 5px 5px 5px 5px; float: right;" title="Field" src="http://brontoversity.com/wp-content/uploads/2010/08/2179082201_8d52cffb60.jpg" alt="Field" width="300" height="241" /></a>Recently, we wrote about <a href="http://brontoversity.com/2010/04/29/create-a-header-without-logging-into-bronto/" target="_blank">creating headers and footers</a> and <a href="http://brontoversity.com/2010/06/11/may-i-have-another-user/" target="_blank">adding new users</a> using the API so that you can update your Bronto account without actually logging into the Bronto application.  We wanted to let you know that can also create contact fields using the API.  These fields allow you to store additional information about your contacts, such as first name, postal code, age, etc. You can also use fields to personalize your messages and segment your lists.</p>
<p>We have discussed how to use these fields in <a href="http://brontoversity.com/2009/06/16/getting-personal-with-your-contacts/" target="_blank">Getting Personal With Your Contacts</a>, but this post will concentrate on how to create the fields using the API.  The SOAP message you will generate to create a field of type text will look like this.</p>
<div style="overflow: auto; width: 535px; height: 300px;">
<pre class="brush:[xml]">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://api.bronto.com/v4"&gt;
  &lt;SOAP-ENV:Header&gt;
  &lt;ns1:sessionHeader&gt;
    &lt;sessionId&gt;ceeac55f-cf56-458d-a3b3-0a2058e0f3d7&lt;/sessionId&gt;
  &lt;/ns1:sessionHeader&gt;
  &lt;/SOAP-ENV:Header&gt;
&lt;SOAP-ENV:Body&gt;
&lt;ns1:addFields&gt;
  &lt;fields&gt;
    &lt;name&gt;Favorite Color Field&lt;/name&gt;
    &lt;label&gt;What is you favorite color&lt;/label&gt;
    &lt;type&gt;text&lt;/type&gt;
    &lt;visibility&gt;public&lt;/visibility&gt;
  &lt;/fields&gt;
&lt;/ns1:addFields&gt;&lt;/SOAP-ENV:Body&gt;</pre>
</div>
<p>The attributes in this SOAP message should be familiar to anyone who has created a contact field in the Bronto application, but they are documented <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=101" target="_blank">here</a>.</p>
<p>Here is a sample of the PHP code that would generate this SOAP message.</p>
<div style="overflow: auto; width: 535px; height: 300px;">
<pre class="brush:[php]">$client = new SoapClient('https://api.bronto.com/v4?wsdl', array('trace' =&gt; 1,
'features' =&gt; SOAP_SINGLE_ELEMENT_ARRAYS));
setlocale(LC_ALL, 'en_US');
try {
  $token = "YOUR TOKEN HERE";
  $sessionId = $client-&gt;login(array('apiToken' =&gt; $token))-&gt;return;
  $session_header = new SoapHeader("http://api.bronto.com/v4",
                                   'sessionHeader',
                                   array('sessionId' =&gt; $sessionId));
  $client-&gt;__setSoapHeaders(array($session_header));
  $field = array('name' =&gt; 'Favorite Color Field',
                 'label' =&gt; 'What is you favorite color',
                 'type' =&gt; 'Text',
                 'visibility' =&gt; 'public');
  $res = $client-&gt;addFields(array($field))-&gt;return;

  if ($res-&gt;errors) {
    echo "There was a problem creating your field:&lt;br&gt;";
    echo $res-&gt;results[$res-&gt;errors[0]]-&gt;errorString . "&lt;br&gt;";
  } else {
    echo "Field has been created.  Id: " . $res-&gt;results[0]-&gt;id . "&lt;br&gt;";
  }
} catch (Exception $e) {
  print "uncaught exception\n";
  print_r($e);
}</pre>
</div>
<p></br><br />
After creating these fields, you can add personalized customer data using the API, as discussed in the post <a href="http://brontoversity.com/2010/05/13/personalize-your-contacts-storing-field-data-with-the-api/" target="_blank">Storing Field Data With The API</a>. Contact fields give you the flexibility to associate data with contacts at a very granular level. You can use this data to add a personal note, add data to URLs in your message, or just include data about the contact. If you have any questions, feel free to leave them in the comments section below.</p>
<p><em>Andrew Kanes<br />
Support Engineer at Bronto</em></p>


<p>Related posts:<ol><li><a href='http://brontoversity.com/2010/07/22/clear-that-list-using-the-api-v4/' rel='bookmark' title='Permanent Link: Clear that List using the API v4'>Clear that List using the API v4</a> <small> Last fall, Alex explained how to Clear Contacts From...</small></li>
<li><a href='http://brontoversity.com/2010/04/29/create-a-header-without-logging-into-bronto/' rel='bookmark' title='Permanent Link: Create a Header Without Logging into Bronto'>Create a Header Without Logging into Bronto</a> <small>Did you know you can now create headers and footers...</small></li>
<li><a href='http://brontoversity.com/2010/08/13/the-pluses-and-minuses/' rel='bookmark' title='Permanent Link: The Pluses And Minuses Of List Management'>The Pluses And Minuses Of List Management</a> <small>What happened to all my lists?!?!? You might be asking...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://brontoversity.com/2010/08/19/adding-contact-fields-using-the-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clear that List using the API v4</title>
		<link>http://brontoversity.com/2010/07/22/clear-that-list-using-the-api-v4/</link>
		<comments>http://brontoversity.com/2010/07/22/clear-that-list-using-the-api-v4/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 19:00:28 +0000</pubDate>
		<dc:creator>Andrew Kanes</dc:creator>
				<category><![CDATA[API Version 4]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[Did You Know?]]></category>
		<category><![CDATA[API version 4]]></category>
		<category><![CDATA[new feature]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://brontoversity.com/?p=8175</guid>
		<description><![CDATA[
Last fall, Alex explained how to Clear Contacts From Lists in v3 of the API. You now have the same ability in v4 API using the clearLists function. All you need to do is specify the list id returned from the addLists or readLists function. After you call clearLists, all your contacts will be removed [...]


Related posts:<ol><li><a href='http://brontoversity.com/2009/09/24/spring-cleaning-clearing-contacts-from-lists/' rel='bookmark' title='Permanent Link: Spring Cleaning: Clearing Contacts From Lists'>Spring Cleaning: Clearing Contacts From Lists</a> <small>This post only applies to Legacy Version 3 of the...</small></li>
<li><a href='http://brontoversity.com/2010/08/13/the-pluses-and-minuses/' rel='bookmark' title='Permanent Link: The Pluses And Minuses Of List Management'>The Pluses And Minuses Of List Management</a> <small>What happened to all my lists?!?!? You might be asking...</small></li>
<li><a href='http://brontoversity.com/2010/04/29/create-a-header-without-logging-into-bronto/' rel='bookmark' title='Permanent Link: Create a Header Without Logging into Bronto'>Create a Header Without Logging into Bronto</a> <small>Did you know you can now create headers and footers...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://brontoversity.com/wp-content/uploads/2010/07/carstobecrushed.jpg"><img style="padding: 5px 5px 5px 5px; float: right;" title="carstobecrushed" src="http://brontoversity.com/wp-content/uploads/2010/07/carstobecrushed.jpg" alt="" width="238" height="161" /></a></p>
<p>Last fall, Alex explained how to <a href="http://brontoversity.com/2009/09/24/spring-cleaning-clearing-contacts-from-lists/" target="_blank">Clear Contacts From Lists</a> in v3 of the API. You now have the same ability in v4 API using the <code>clearLists</code> function. All you need to do is specify the list id returned from the <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=102" target="_blank">addLists</a> or <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=6" target="_blank">readLists</a> function. After you call <code>clearLists</code>, all your contacts will be removed from the list, however, they will remain in Bronto.</p>
<p>Here is a sample SOAP message that would clear two lists.</p>
<pre class="brush:[php]">
<div id="_mcePaste">&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v4="http://api.bronto.com/v4"&gt;
   &lt;soapenv:Header&gt;
      &lt;v4:sessionHeader&gt;
         &lt;sessionId&gt;b058d5e0-7cb4-4578-b16f-a4c049079207&lt;/sessionId&gt;
      &lt;/v4:sessionHeader&gt;
   &lt;/soapenv:Header&gt;
   &lt;soapenv:Body&gt;
      &lt;v4:clearLists&gt;
         &lt;list&gt;
            &lt;id&gt;0bbb03ec0000000000000000000000038e93&lt;/id&gt;
         &lt;/list&gt;
         &lt;list&gt;
            &lt;id&gt;0bbb03ec00000000000000000000000390d0&lt;/id&gt;
        &lt;/list&gt;
      &lt;/v4:clearLists&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</div>
</pre>
<p>This PHP script would create a SOAP message like this.</p>
<pre class="brush:[php]">&lt;?php
/**
 * This example will clear two lists of all contacts on those lists.
 * You must edit the code to refer to the list id you wish to clear.
 */

$client = new SoapClient('https://api.bronto.com/v4?wsdl', array('trace' =&gt; 1, 'features' =&gt; SOAP_SINGLE_ELEMENT_ARRAYS));
setlocale(LC_ALL, 'en_US');

try {
        $token = "#####API TOKEN###########";

        print "logging in&lt;br&gt;";
        $sessionId = $client-&gt;login(array('apiToken' =&gt; $token))-&gt;return;

        $session_header = new SoapHeader("http://api.bronto.com/v4",
                           'sessionHeader', array('sessionId' =&gt; $sessionId));
        $client-&gt;__setSoapHeaders(array($session_header));

        $ids = array(array('id' =&gt; '0bbb03ec0000000000000000000000038e93'),
                   array('id' =&gt; '0bbb03ec00000000000000000000000390d0'));

        $res = $client-&gt;clearLists($ids)-&gt;return;

        if ($res-&gt;errors) {
                print "There was a problem clearing your lists:&lt;br&gt;";
                print $res-&gt;results[$res-&gt;errors[0]]-&gt;errorString . "&lt;br&gt;";
        } else {
                print "Lists have been cleared&lt;br&gt;";
        }
} catch (Exception $e) {
        print "uncaught exception\n";
        print_r($e);
}
?&gt;</pre>
<p>Now you are able to quickly and easily clear your lists without having to find everyone on the list. We do suggest you exercise caution when using this function, as there is no rewind button. I hope you find this new functionality useful. Let us know if you have any questions.</p>
<p><span style="font-family: Verdana, sans-serif; line-height: 20px; color: #111111;"><em>Andrew Kanes<br style="padding: 0px; margin: 0px;" />Support Engineer at Bronto</em></span></p>


<p>Related posts:<ol><li><a href='http://brontoversity.com/2009/09/24/spring-cleaning-clearing-contacts-from-lists/' rel='bookmark' title='Permanent Link: Spring Cleaning: Clearing Contacts From Lists'>Spring Cleaning: Clearing Contacts From Lists</a> <small>This post only applies to Legacy Version 3 of the...</small></li>
<li><a href='http://brontoversity.com/2010/08/13/the-pluses-and-minuses/' rel='bookmark' title='Permanent Link: The Pluses And Minuses Of List Management'>The Pluses And Minuses Of List Management</a> <small>What happened to all my lists?!?!? You might be asking...</small></li>
<li><a href='http://brontoversity.com/2010/04/29/create-a-header-without-logging-into-bronto/' rel='bookmark' title='Permanent Link: Create a Header Without Logging into Bronto'>Create a Header Without Logging into Bronto</a> <small>Did you know you can now create headers and footers...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://brontoversity.com/2010/07/22/clear-that-list-using-the-api-v4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Token, Token, Who Wants a Token?</title>
		<link>http://brontoversity.com/2010/06/17/token-token-who-wants-a-token/</link>
		<comments>http://brontoversity.com/2010/06/17/token-token-who-wants-a-token/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 21:29:55 +0000</pubDate>
		<dc:creator>Andrew Kanes</dc:creator>
				<category><![CDATA[API Version 4]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[API version 4]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://brontoversity.com/?p=7699</guid>
		<description><![CDATA[Another new feature of version 4 of the Bronto API is the ability for Agency accounts to create tokens programatically. We have already talked about how to add new accounts and how to add new users, and now with newly released function addApiTokens, Agency accounts can add tokens without having to log into the Bronto application. In this [...]


Related posts:<ol><li><a href='http://brontoversity.com/2010/06/11/may-i-have-another-user/' rel='bookmark' title='Permanent Link: May I Have Another User'>May I Have Another User</a> <small>As part of version 4 of the Bronto API, we...</small></li>
<li><a href='http://brontoversity.com/2010/07/22/clear-that-list-using-the-api-v4/' rel='bookmark' title='Permanent Link: Clear that List using the API v4'>Clear that List using the API v4</a> <small> Last fall, Alex explained how to Clear Contacts From...</small></li>
<li><a href='http://brontoversity.com/2010/05/27/agencies-can-create-new-accounts-using-the-api/' rel='bookmark' title='Permanent Link: Agencies Can Create New Accounts Using The API'>Agencies Can Create New Accounts Using The API</a> <small>Last month we discussed how to create headers and footers...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://brontoversity.com/wp-content/uploads/2010/06/brisbanebridge.jpg"><img style="float: right;padding: 5px 5px 5px 5px" src="http://brontoversity.com/wp-content/uploads/2010/06/brisbanebridge.jpg" alt="" width="270" height="191" /></a>Another new feature of version 4 of the Bronto API is the ability for Agency accounts to create tokens programatically. We have already talked about <a href="http://brontoversity.com/2010/05/27/agencies-can-create-new-accounts-using-the-api/" target="_new">how to add new accounts</a> and <a href="http://brontoversity.com/2010/06/11/may-i-have-another-user/" target="_blank">how to add new users</a>, and now with newly released function <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=113" target="_blank">addApiTokens</a>, Agency accounts can add tokens without having to log into the Bronto application. In this post I will take a look at the new functions that allow Agency accounts to manage their tokens.</p>
<p>As with our other API functions, there is not only the ability to <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=113" target="_blank">add</a>, but also to <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=23">read</a>, <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=410">update</a> and <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=510">delete</a> API Tokens. These functions give API users the ability to manipulate their API Tokens just as a user logged into the web application is able to.</p>
<h3>Let&#8217;s Jump In</h3>
<p>First let&#8217;s take a look at an example of a SOAP message to create a token:</p>
<div style="height: 300px;overflow: auto;border: 1px solid"><code><br />
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v4="http://api.bronto.com/v4"&gt;<br />
&lt;soapenv:Header&gt;<br />
&lt;v4:sessionHeader&gt;<br />
&lt;sessionId&gt;xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&lt;/sessionId&gt;<br />
&lt;/v4:sessionHeader&gt;<br />
&lt;/soapenv:Header&gt;<br />
&lt;soapenv:Body&gt;<br />
&lt;v4:addApiTokens&gt;<br />
&lt;tokens&gt;<br />
&lt;name&gt;Name of Token&lt;/name&gt;<br />
&lt;permissions&gt;7&lt;/permissions&gt;<br />
&lt;active&gt;true&lt;/active&gt;<br />
&lt;accountId&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&lt;/accountId&gt;<br />
&lt;/tokens&gt;<br />
&lt;/v4:addApiTokens&gt;<br />
&lt;/soap:Body&gt;<br />
&lt;/soap:Envelope&gt;<br />
</code></div>
<p>The response message that is returned by the API will contain the Id of the newly created token and will look like this:</p>
<div style="height: 300px;overflow: auto;border: 1px solid">
<p><code> </code><code>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;<br />
&lt;soap:Body&gt;<br />
&lt;ns2:addApiTokensResponse xmlns:ns2="http://api.bronto.com/v4"&gt;<br />
&lt;return&gt;<br />
&lt;results&gt;<br />
&lt;id&gt;xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&lt;/id&gt;<br />
&lt;isNew&gt;true&lt;/isNew&gt;<br />
&lt;isError&gt;false&lt;/isError&gt;<br />
&lt;errorCode&gt;0&lt;/errorCode&gt;<br />
&lt;/results&gt;<br />
&lt;/return&gt;<br />
&lt;/ns2:addApiTokensResponse&gt;<br />
&lt;/soap:Body&gt;<br />
&lt;/soap:Envelope&gt;<br />
</code></p>
</div>
<p>You can then use the Id to reference that token, for instance when using the <code>readApiTokens</code>.</p>
<div style="height: 300px;overflow: auto;border: 1px solid"><code><br />
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v4="http://api.bronto.com/v4"&gt;<br />
&lt;soapenv:Header&gt;<br />
&lt;v4:sessionHeader&gt;<br />
&lt;sessionId&gt;xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&lt;/sessionId&gt;<br />
&lt;/v4:sessionHeader&gt;<br />
&lt;/soapenv:Header&gt;<br />
&lt;soapenv:Body&gt;<br />
&lt;v4:readApiTokens&gt;<br />
&lt;tokens&gt;<br />
&lt;filter&gt;<br />
&lt;id&gt;xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&lt;/id&gt;<br />
&lt;/filter&gt;<br />
&lt;pageNumber&gt;1&lt;/pageNumber&gt;<br />
&lt;/tokens&gt;<br />
&lt;/v4:readApiTokens&gt;<br />
&lt;/soap:Body&gt;<br />
&lt;/soap:Envelope&gt;<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif"><span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif"><br />
</span><br />
</span></code></div>
<p>You can also use the filters available for <code>readApiTokens</code> to search for tokens based on their name, or return all the tokens available to a sub-account or an entire agency. Of course, after you create the API Token, you are now able to use it to <a href="http://brontoversity.com/2010/03/18/logging-into-the-new-api-v4-0/" target="_blank">log into the API</a>. We hope you find this new functionality useful and please let us know if you have any questions.</p>
<p><em>Andrew Kanes</em><br />
<em>Support Engineer at Bronto</em></p>


<p>Related posts:<ol><li><a href='http://brontoversity.com/2010/06/11/may-i-have-another-user/' rel='bookmark' title='Permanent Link: May I Have Another User'>May I Have Another User</a> <small>As part of version 4 of the Bronto API, we...</small></li>
<li><a href='http://brontoversity.com/2010/07/22/clear-that-list-using-the-api-v4/' rel='bookmark' title='Permanent Link: Clear that List using the API v4'>Clear that List using the API v4</a> <small> Last fall, Alex explained how to Clear Contacts From...</small></li>
<li><a href='http://brontoversity.com/2010/05/27/agencies-can-create-new-accounts-using-the-api/' rel='bookmark' title='Permanent Link: Agencies Can Create New Accounts Using The API'>Agencies Can Create New Accounts Using The API</a> <small>Last month we discussed how to create headers and footers...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://brontoversity.com/2010/06/17/token-token-who-wants-a-token/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Agencies Can Create New Accounts Using The API</title>
		<link>http://brontoversity.com/2010/05/27/agencies-can-create-new-accounts-using-the-api/</link>
		<comments>http://brontoversity.com/2010/05/27/agencies-can-create-new-accounts-using-the-api/#comments</comments>
		<pubDate>Thu, 27 May 2010 18:59:36 +0000</pubDate>
		<dc:creator>Andrew Kanes</dc:creator>
				<category><![CDATA[API Version 4]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Agency Edition]]></category>
		<category><![CDATA[API version 4]]></category>
		<category><![CDATA[client account creation]]></category>

		<guid isPermaLink="false">http://brontoversity.com/?p=7405</guid>
		<description><![CDATA[Last month we discussed how to  create headers and footers using the new API function addHeaderFooters, instead of logging into the Bronto application. To help our Agency accounts, we have also introduced the function addAccounts that allows you to create an agency client account without logging into Bronto.
The new function and its related functions [...]


Related posts:<ol><li><a href='http://brontoversity.com/2010/06/17/token-token-who-wants-a-token/' rel='bookmark' title='Permanent Link: Token, Token, Who Wants a Token?'>Token, Token, Who Wants a Token?</a> <small>Another new feature of version 4 of the Bronto API...</small></li>
<li><a href='http://brontoversity.com/2010/06/11/may-i-have-another-user/' rel='bookmark' title='Permanent Link: May I Have Another User'>May I Have Another User</a> <small>As part of version 4 of the Bronto API, we...</small></li>
<li><a href='http://brontoversity.com/2010/04/29/create-a-header-without-logging-into-bronto/' rel='bookmark' title='Permanent Link: Create a Header Without Logging into Bronto'>Create a Header Without Logging into Bronto</a> <small>Did you know you can now create headers and footers...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Last month we discussed how to <a href="http://brontoversity.com/wp-content/uploads/2010/05/airtractor.jpg"><img style="padding: 5px 5px 5px 5px;float: right" src="http://brontoversity.com/wp-content/uploads/2010/05/airtractor.jpg" alt="" width="256" height="166" /></a><a href="http://brontoversity.com/2010/04/29/create-a-header-without-logging-into-bronto/" target="_blank"> create headers and footers</a> using the new API function <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=108" target="_blank">addHeaderFooters</a>, instead of logging into the Bronto application. To help our Agency accounts, we have also introduced the function <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=107" target="_blank">addAccounts</a> that allows you to create an agency client account without logging into Bronto.</p>
<p>The new function and its related functions <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=500" target="_blank">deleteAccounts</a>, <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=1" target="_blank">readAccounts</a> and <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=400" target="_blank">updateAccounts</a> allows you to maintain your client accounts from outside the Bronto application.  The arguments for this function fall into <a href="http://app.bronto.com/api/?q=v4_o_view&amp;fn=View&amp;id=26" target="_blank">generalSettings</a>, <a href="http://app.bronto.com/api/?q=v4_o_view&amp;fn=View&amp;id=27" target="_blank">contactInformation</a>, <a href="http://app.bronto.com/api/?q=v4_o_view&amp;fn=View&amp;id=28" target="_blank">formatSettings</a>, <a href="http://app.bronto.com/api/?q=v4_o_view&amp;fn=View&amp;id=29" target="_blank">brandingSettings</a>, <a href="http://app.bronto.com/api/?q=v4_o_view&amp;fn=View&amp;id=30" target="_blank">repliesSettings</a> and <a href="http://app.bronto.com/api/?q=v4_o_view&amp;fn=View&amp;id=37" target="_blank">allocations</a>.  You can use these new functions to integrate Bronto into an external application where you preform other work, there by cutting down on the time you spend switching between applications.  To do this you would need to generate a SOAP message like this:</p>
<div style="border: 1px solid;overflow: auto;height: 225px;padding: 10px">
<p><code><br />
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v4="http://api.bronto.com/v4"&gt;<br />
&lt;soapenv:Header&gt;<br />
&lt;v4:sessionHeader&gt;<br />
&lt;sessionId&gt;79811a0f-xxxx-xxxx-xxxx-3c495d1bdbee&lt;/sessionId&gt;<br />
&lt;/v4:sessionHeader&gt;<br />
&lt;/soapenv:Header&gt;<br />
&lt;soapenv:Body&gt;<br />
&lt;v4:addAccounts&gt;<br />
&lt;accounts&gt;&lt;name&gt;AddTestAccount&lt;/name&gt;<br />
&lt;generalSettings&gt;<br />
&lt;siteName&gt;subaccount_test_account&lt;/siteName&gt;<br />
&lt;emergencyEmail&gt;example@bronto.com&lt;/emergencyEmail&gt;<br />
&lt;bounceLimit&gt;5&lt;/bounceLimit&gt;<br />
&lt;dailyFrequencyCap&gt;5&lt;/dailyFrequencyCap&gt;<br />
&lt;weeklyFrequencyCap&gt;5&lt;/weeklyFrequencyCap&gt;<br />
&lt;monthlyFrequencyCap&gt;5&lt;/monthlyFrequencyCap&gt;<br />
&lt;textDelivery&gt;1&lt;/textDelivery&gt;<br />
&lt;textPreference&gt;1&lt;/textPreference&gt;<br />
&lt;useSSL&gt;1&lt;/useSSL&gt;<br />
&lt;currentContacts&gt;0&lt;/currentContacts&gt;<br />
&lt;maxContacts&gt;10000&lt;/maxContacts&gt;<br />
&lt;currentMonthlyEmails&gt;10000&lt;/currentMonthlyEmails&gt;<br />
&lt;currentHostingSize&gt;10&lt;/currentHostingSize&gt;<br />
&lt;maxHostingSize&gt;10&lt;/maxHostingSize&gt;<br />
&lt;/generalSettings&gt;<br />
&lt;contactInformation&gt;<br />
&lt;organization&gt;organization name&lt;/organization&gt;<br />
&lt;firstName&gt;first name&lt;/firstName&gt;<br />
&lt;lastName&gt;last name&lt;/lastName&gt;<br />
&lt;email&gt;example@bronto.com&lt;/email&gt;<br />
&lt;phone&gt;phone&lt;/phone&gt;<br />
&lt;address&gt;address&lt;/address&gt;<br />
&lt;address2&gt;address2&lt;/address2&gt;<br />
&lt;city&gt;city&lt;/city&gt;<br />
&lt;state&gt;state&lt;/state&gt;<br />
&lt;zip&gt;zip&lt;/zip&gt;<br />
&lt;country&gt;country&lt;/country&gt;<br />
&lt;notes&gt;notes here&lt;/notes&gt;<br />
&lt;/contactInformation&gt;<br />
&lt;allocation&gt;<br />
&lt;startDate&gt;2010-05-10T19:20:30-05:00&lt;/startDate&gt;<br />
&lt;periodFrequency&gt;12&gt;&lt;/periodFrequency&gt;<br />
&lt;emails&gt;10000&lt;/emails&gt;<br />
&lt;api&gt;false&lt;/api&gt;<br />
&lt;bundle&gt;intermediate&lt;/bundle&gt;<br />
&lt;/allocation&gt;<br />
&lt;formatSettings&gt;<br />
&lt;/formatSettings&gt;<br />
&lt;brandingSettings&gt;<br />
&lt;/brandindSettings&gt;<br />
&lt;repliesSettings&gt;<br />
&lt;/repliesSettings&gt;<br />
&lt;/accounts&gt;<br />
&lt;/v4:addAccounts&gt;<br />
&lt;/soapenv:Body&gt;<br />
&lt;/soapenv:Envelope&gt;<br />
</code></p>
</div>
<p><br/><br />
Of course, after you create your client accounts, you can do a <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=1" target="_blank">readAccounts</a> to display information about those clients accounts in another application.  Then using <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=400" target="_blank">updateAccounts</a>, you can update a client account and maintain it without having to switch over to Bronto.  You could also set up an automatic system to examine your client accounts on a regular basis and alert you if any are approaching a limit, such as maximum number of contacts allowed in the current allocation period.</p>
<p>If you have any questions, feel free to leave them in the comments section below.</p>
<p><em>Andrew Kanes<br />
Support Engineer at Bronto</em></p>


<p>Related posts:<ol><li><a href='http://brontoversity.com/2010/06/17/token-token-who-wants-a-token/' rel='bookmark' title='Permanent Link: Token, Token, Who Wants a Token?'>Token, Token, Who Wants a Token?</a> <small>Another new feature of version 4 of the Bronto API...</small></li>
<li><a href='http://brontoversity.com/2010/06/11/may-i-have-another-user/' rel='bookmark' title='Permanent Link: May I Have Another User'>May I Have Another User</a> <small>As part of version 4 of the Bronto API, we...</small></li>
<li><a href='http://brontoversity.com/2010/04/29/create-a-header-without-logging-into-bronto/' rel='bookmark' title='Permanent Link: Create a Header Without Logging into Bronto'>Create a Header Without Logging into Bronto</a> <small>Did you know you can now create headers and footers...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://brontoversity.com/2010/05/27/agencies-can-create-new-accounts-using-the-api/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Create a Header Without Logging into Bronto</title>
		<link>http://brontoversity.com/2010/04/29/create-a-header-without-logging-into-bronto/</link>
		<comments>http://brontoversity.com/2010/04/29/create-a-header-without-logging-into-bronto/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 19:05:53 +0000</pubDate>
		<dc:creator>Andrew Kanes</dc:creator>
				<category><![CDATA[API Version 4]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[API version 4]]></category>
		<category><![CDATA[footers]]></category>
		<category><![CDATA[headers]]></category>

		<guid isPermaLink="false">http://brontoversity.com/?p=7266</guid>
		<description><![CDATA[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 [...]


Related posts:<ol><li><a href='http://brontoversity.com/2010/05/27/agencies-can-create-new-accounts-using-the-api/' rel='bookmark' title='Permanent Link: Agencies Can Create New Accounts Using The API'>Agencies Can Create New Accounts Using The API</a> <small>Last month we discussed how to create headers and footers...</small></li>
<li><a href='http://brontoversity.com/2010/07/22/clear-that-list-using-the-api-v4/' rel='bookmark' title='Permanent Link: Clear that List using the API v4'>Clear that List using the API v4</a> <small> Last fall, Alex explained how to Clear Contacts From...</small></li>
<li><a href='http://brontoversity.com/2010/08/19/adding-contact-fields-using-the-api/' rel='bookmark' title='Permanent Link: Adding Contact Fields using the API'>Adding Contact Fields using the API</a> <small>Recently, we wrote about creating headers and footers and adding...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img style="padding: 5px 5px 5px 5px;float: right" src="http://brontoversity.com/wp-content/uploads/2010/04/3529534404_3a565309f8.jpg" alt="frowzy-headed Fishers" width="250" height="177" />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 <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=108" target="_blank">addHeaderFooters</a>.</p>
<p>This new function, and its associated functions <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=503" target="_blank">deleteHeaderFooters</a>, <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=5" target="_blank">readHeaderFooters</a> and <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=403" target="_blank">updateHeaderFooters</a>, allows you to manipulate the name and contents of your headers and footers from outside the Bronto application. The arguments are <code>name</code>, <code>html</code>, <code>text</code> and <code>isHeader</code>. 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.</p>
<p>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</p>
<div style="border: 1px solid;overflow: auto;height: 225px;padding: 10px">
<p><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v4="http://api.bronto.com/v4"&gt;<br />
&lt;soapenv:Header&gt;<br />
&lt;v4:sessionHeader&gt;<br />
&lt;sessionId&gt;840ae3a0-2e4f-478e-bc54-0f2e9bebce26&lt;/sessionId&gt;<br />
&lt;/v4:sessionHeader&gt;<br />
&lt;/soapenv:Header&gt;<br />
&lt;soapenv:Body&gt;<br />
&lt;v4:addHeaderFooters&gt;<br />
&lt;footers&gt;<br />
&lt;name&gt;Header Created using the API&lt;/name&gt;<br />
&lt;html&gt;This is the &lt;b&gt;HTML content&lt;/b&gt; of the new header&lt;/html&gt;<br />
&lt;text&gt;This is the Text content of the new header&lt;/text&gt;<br />
&lt;isHeader&gt;true&lt;/isHeader&gt;<br />
&lt;/footers&gt;<br />
&lt;/v4:addHeaderFooters&gt;<br />
&lt;/soapenv:Body&gt;<br />
&lt;/soapenv:Envelope&gt;<br />
</code></p>
</div>
<p><br/></p>
<p>
Here is some sample PHP code to generate this SOAP message:
</p>
<div style="border: 1px solid;overflow: auto;height: 225px;padding: 10px"><code><br />
$sessionId = $client-&gt;login(array('apiToken' =&gt; $token))-&gt;return;</code></p>
<p><code>$session_header = new SoapHeader("http://api.bronto.com/v4",<br />
'sessionHeader',<br />
array('sessionId' =&gt; $sessionId));<br />
$client-&gt;__setSoapHeaders(array($session_header));</code></p>
<p><code>$html = 'This is the &gt;b&gt;HTML content&gt;/b&gt; of the new header';<br />
$text = 'This is the Text content of the new header';</code></p>
<p><code>$header = array('name' =&gt; 'Header Created using the API',<br />
'html' =&gt; $html,<br />
'text' =&gt; $text,<br />
'isHeader' =&gt; 'true');</code></p>
<p><code> $res = $client-&gt;addHeaderFooters(array($header))-&gt;return;<br />
</code></p>
</div>
<p><br/><br />
If you have any questions, feel free to leave them in the comments section below.</p>
<p><em>Andrew Kanes<br />
Support Engineer at Bronto</em></p>


<p>Related posts:<ol><li><a href='http://brontoversity.com/2010/05/27/agencies-can-create-new-accounts-using-the-api/' rel='bookmark' title='Permanent Link: Agencies Can Create New Accounts Using The API'>Agencies Can Create New Accounts Using The API</a> <small>Last month we discussed how to create headers and footers...</small></li>
<li><a href='http://brontoversity.com/2010/07/22/clear-that-list-using-the-api-v4/' rel='bookmark' title='Permanent Link: Clear that List using the API v4'>Clear that List using the API v4</a> <small> Last fall, Alex explained how to Clear Contacts From...</small></li>
<li><a href='http://brontoversity.com/2010/08/19/adding-contact-fields-using-the-api/' rel='bookmark' title='Permanent Link: Adding Contact Fields using the API'>Adding Contact Fields using the API</a> <small>Recently, we wrote about creating headers and footers and adding...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://brontoversity.com/2010/04/29/create-a-header-without-logging-into-bronto/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using the New readContacts Function</title>
		<link>http://brontoversity.com/2010/04/08/using-the-new-readcontacts-function/</link>
		<comments>http://brontoversity.com/2010/04/08/using-the-new-readcontacts-function/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 19:29:18 +0000</pubDate>
		<dc:creator>Andrew Kanes</dc:creator>
				<category><![CDATA[API Version 4]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[API version 4]]></category>

		<guid isPermaLink="false">http://brontoversity.com/?p=6961</guid>
		<description><![CDATA[Over the past few weeks, we have looked at how to login to the new API and how to filter result sets. Now we are going to take a closer look at how to work with the updated readContacts function, and see what new information is provided to us in the result. As was mentioned [...]


Related posts:<ol><li><a href='http://brontoversity.com/2010/03/25/filtering-result-sets/' rel='bookmark' title='Permanent Link: Filtering Result Sets'>Filtering Result Sets</a> <small>Did you know that all of the read functions available...</small></li>
<li><a href='http://brontoversity.com/2010/06/17/token-token-who-wants-a-token/' rel='bookmark' title='Permanent Link: Token, Token, Who Wants a Token?'>Token, Token, Who Wants a Token?</a> <small>Another new feature of version 4 of the Bronto API...</small></li>
<li><a href='http://brontoversity.com/2010/04/29/create-a-header-without-logging-into-bronto/' rel='bookmark' title='Permanent Link: Create a Header Without Logging into Bronto'>Create a Header Without Logging into Bronto</a> <small>Did you know you can now create headers and footers...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://brontoversity.com/wp-content/uploads/2010/04/reading_faxed_newspaper.jpg"><img style="padding: 5px 5px 5px 5px; float: right;" src="http://brontoversity.com/wp-content/uploads/2010/04/reading_faxed_newspaper.jpg" alt="" width="300" height="246" /></a>Over the past few weeks, we have looked at how to <a href="http://brontoversity.com/2010/03/18/logging-into-the-new-api-v4-0/" target="_new">login</a> to the new API and how to <a href="http://brontoversity.com/2010/03/25/filtering-result-sets/" target="_new">filter</a> result sets. Now we are going to take a closer look at how to work with the updated <a href="http://app.bronto.com/api/?q=v4_f_view&amp;fn=View&amp;id=2" target="_new">readContacts function</a>, and see what new information is provided to us in the result. As was mentioned in  <a href="http://brontoversity.com/2010/03/25/filtering-result-sets/" target="_new">Filtering Result Sets</a>, all of the read functions in version 4 of the Bronto API, including readContacts, have the option to include a filter based on selected criteria.  You can find out what criteria are available by looking at the <a href="http://app.bronto.com/api/?q=v4_o_view&amp;fn=View&amp;id=108" target="_new">contactFilter</a></p>
<h3>Using the contactFilter</h3>
<p>Lets say you were interested in all active contacts created after June 1, 2009 at 6am ET.  You would create a SOAP message like:</p>
<div style="border: 1px solid; overflow: auto; height: 225px; padding: 10px;"><code><br />
&lt;soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:v4=”http://api.bronto.com/v4″&gt;<br />
&lt;soapenv:Header&gt;<br />
&lt;v4:sessionHeader&gt;<br />
&lt;sessionId&gt;&lt;/sessionId&gt;<br />
&lt;/v4:sessionHeader&gt;<br />
&lt;/soapenv:Header&gt;<br />
&lt;soapenv:Body&gt;<br />
&lt;v4:readContacts&gt;<br />
&lt;filter&gt;<br />
&lt;type&gt;AND&lt;/type&gt;<br />
&lt;status&gt;active&lt;/status&gt;<br />
&lt;created&gt;<br />
&lt;operator&gt;After&lt;/operator&gt;<br />
&lt;value&gt;2009-06-01T06:00:00-05:00&lt;/value&gt;<br />
&lt;/created&gt;<br />
&lt;/filter&gt;<br />
&lt;includeLists&gt;false&lt;/includeLists&gt;<br />
&lt;fields&gt;&lt;/fields&gt;<br />
&lt;pageNumber&gt;1&lt;/pageNumber&gt;<br />
&lt;/v4:readContacts&gt;<br />
&lt;/soapenv:Body&gt;<br />
&lt;/soapenv:Envelope&gt;<br />
</code></div>
<p></br><br />
Using the readContacts function, you can also filter on criteria such as email address, modified date, which lists or segments the contacts are on, message format preference, source and customSource. You can also specify if the contacts should match all or any of the filter criteria by defining the filter type as an AND or an OR.</p>
<h3>Aggregate Information Returned by the readContact Function</h3>
<p>The updated readContact function also returns aggregate information for each contact. The results now include numSends, numBounces, numOpens, numClicks, numConversions and conversionAmount. These metrics tell you the total number of deliveries sent to a contact, the number of times deliveries sent to a contact that have bounced, the number of opens recorded for the contact, the number of clicks recorded for the contact, the total number of times a contact has converted, and the total amount of any conversions. This is in addition to all the other information about a contact that is returned.</p>
<p>Let us know if you have any suggestions or questions in the comments section below!</p>
<p><em>Andrew Kanes<br />
Support Engineer at Bronto</em></p>


<p>Related posts:<ol><li><a href='http://brontoversity.com/2010/03/25/filtering-result-sets/' rel='bookmark' title='Permanent Link: Filtering Result Sets'>Filtering Result Sets</a> <small>Did you know that all of the read functions available...</small></li>
<li><a href='http://brontoversity.com/2010/06/17/token-token-who-wants-a-token/' rel='bookmark' title='Permanent Link: Token, Token, Who Wants a Token?'>Token, Token, Who Wants a Token?</a> <small>Another new feature of version 4 of the Bronto API...</small></li>
<li><a href='http://brontoversity.com/2010/04/29/create-a-header-without-logging-into-bronto/' rel='bookmark' title='Permanent Link: Create a Header Without Logging into Bronto'>Create a Header Without Logging into Bronto</a> <small>Did you know you can now create headers and footers...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://brontoversity.com/2010/04/08/using-the-new-readcontacts-function/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Logging into the new API v4.0</title>
		<link>http://brontoversity.com/2010/03/18/logging-into-the-new-api-v4-0/</link>
		<comments>http://brontoversity.com/2010/03/18/logging-into-the-new-api-v4-0/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 18:35:27 +0000</pubDate>
		<dc:creator>Andrew Kanes</dc:creator>
				<category><![CDATA[API Version 4]]></category>
		<category><![CDATA[API Legacy Version 3]]></category>
		<category><![CDATA[API version 4]]></category>

		<guid isPermaLink="false">http://brontoversity.com/?p=6663</guid>
		<description><![CDATA[
This past week, Bronto was proud to introduce many new features in accordance with our Spring 2010 Release. The release also included a new version of the API (version 4). While the old API (legacy version 3) is not going away, the new version is the one Bronto will be concentrating on and developing new [...]


Related posts:<ol><li><a href='http://brontoversity.com/2010/08/13/the-pluses-and-minuses/' rel='bookmark' title='Permanent Link: The Pluses And Minuses Of List Management'>The Pluses And Minuses Of List Management</a> <small>What happened to all my lists?!?!? You might be asking...</small></li>
<li><a href='http://brontoversity.com/2010/04/29/create-a-header-without-logging-into-bronto/' rel='bookmark' title='Permanent Link: Create a Header Without Logging into Bronto'>Create a Header Without Logging into Bronto</a> <small>Did you know you can now create headers and footers...</small></li>
<li><a href='http://brontoversity.com/2010/07/22/clear-that-list-using-the-api-v4/' rel='bookmark' title='Permanent Link: Clear that List using the API v4'>Clear that List using the API v4</a> <small> Last fall, Alex explained how to Clear Contacts From...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://brontoversity.com/wp-content/uploads/2010/03/rune_stone.jpg"><img style="padding: 5px 5px 5px 5px; float: right;" src="http://brontoversity.com/wp-content/uploads/2010/03/rune_stone.jpg" alt="" width="171" height="240" /></a></p>
<div>This past week, Bronto was proud to introduce many new features in accordance with our Spring 2010 Release. The release also included a new version of the API (version 4). While the old API (legacy version 3) is not going away, the new version is the one Bronto will be concentrating on and developing new features for. The new API will give you access to more Bronto objects and improved filtering of those objects. Along with the improvements made in the new API are a few changes. One of the main changes is how you authenticate or log into the API. You are no longer required to create an API user with the appropriate permissions. Instead, you will create an API token. Once you have been authenticated, you will be returned a <code>sessionId</code> that you will use for the rest of you session.</div>
<h3>Creating a token</h3>
<div>To create a token, go to <strong>Home-&gt;Settings-&gt;Data Exchange</strong> and click <strong>Add Access Token</strong>. The token can be limited in the actions it can perform, such as read, write, or send. Hence, you can configure each token you create and allow it do any one of those actions, a combination, or all of them.</div>
<div><a href="http://brontoversity.com/wp-content/uploads/2010/03/create_token.jpg"><img style="padding: 5px 5px 5px 5px; float: middle;" src="http://brontoversity.com/wp-content/uploads/2010/03/create_token.jpg" alt="Create token screen shot" width="555" height="514" /></a></div>
<div>
<h3>Some Example Code (PHP and JAVA AXIS)</h3>
<p>Below is some example code you can use to get an idea of how to login to the new API.</p>
<h4>PHP</h4>
<div style="border: 1px solid; overflow: auto; height: 225px; padding: 10px;"><code><br />
/*<br />
This example script will connect to the API and authenticate a session.<br />
Be sure to replace the "ADD YOUR API TOKEN HERE" text with a working<br />
API Token.<br />
*/<br />
<code><br />
ini_set("soap.wsdl_cache_enabled", "0");<br />
date_default_timezone_set('America/New_York');<br />
</code><br />
<code><br />
$wsdl = "https://api.bronto.com/v4?wsdl";<br />
$url = "https://api.bronto.com/v4";</code><br />
<code><br />
$client = new SoapClient($wsdl, array('trace' =&gt; 1, 'encoding' =&gt; 'UTF-8'));<br />
$client-&gt;__setLocation($url);</code><br />
</code><br />
<code>$token = "ADD YOUR API TOKEN HERE";<br />
$sessionId = $client-&gt;login(array("apiToken" =&gt; $token))-&gt;return;<br />
$client-&gt;__setSoapHeaders(array(new SoapHeader("https://api.bronto.com", 'sessionId', $sessionId)));<br />
</code></p>
</div>
<h4>JAVA AXIS</h4>
<div style="border: 1px solid; overflow: auto; height: 225px;"><code><br />
/**<br />
* This example program will connect to the API and authenticate a session.<br />
*/</code></p>
<p><code>package com.bronto;</code></p>
<p><code>import org.apache.axis.client.Stub;</code></p>
<p><code>import com.bronto.api.objects.BrontoSoapApi;<br />
import com.bronto.api.objects.BrontoSoapApiImplService;<br />
import com.bronto.api.objects.BrontoSoapApiImplServiceLocator;<br />
import com.bronto.api.objects.StringValue;</code></p>
<p><code>public class TestLoginBronto {<br />
private static final String API_TOKEN = "ADD YOUR API TOKEN HERE";</code></p>
<p><code>public static void main(String args[]) throws Exception {<br />
BrontoSoapApiImplService locator = new BrontoSoapApiImplServiceLocator();<br />
BrontoSoapApi api = locator.getBrontoSoapApiImplPort();</code></p>
<p><code>// Login<br />
String sessionId = api.login(API_TOKEN);<br />
if (sessionId == null) {<br />
System.out.println("Login failed.");<br />
return;<br />
}<br />
((Stub)api).setHeader(locator.getServiceName().getNamespaceURI(), "sessionId", sessionId);</code></p>
<p><code>System.out.println("Login was successful.");<br />
}<br />
}</code></p>
</div>
<h3>Lots More</h3>
<p>With its expanded functionality and improved design, the new API provides many exciting opportunities to integrate with your systems outside of Bronto. We hope you enjoy the new API as much as we enjoy bringing it to you.</p>
<p><em>Andrew Kanes</em><br />
<em>Support Engineer at Bronto</em></p>
</div>


<p>Related posts:<ol><li><a href='http://brontoversity.com/2010/08/13/the-pluses-and-minuses/' rel='bookmark' title='Permanent Link: The Pluses And Minuses Of List Management'>The Pluses And Minuses Of List Management</a> <small>What happened to all my lists?!?!? You might be asking...</small></li>
<li><a href='http://brontoversity.com/2010/04/29/create-a-header-without-logging-into-bronto/' rel='bookmark' title='Permanent Link: Create a Header Without Logging into Bronto'>Create a Header Without Logging into Bronto</a> <small>Did you know you can now create headers and footers...</small></li>
<li><a href='http://brontoversity.com/2010/07/22/clear-that-list-using-the-api-v4/' rel='bookmark' title='Permanent Link: Clear that List using the API v4'>Clear that List using the API v4</a> <small> Last fall, Alex explained how to Clear Contacts From...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://brontoversity.com/2010/03/18/logging-into-the-new-api-v4-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Welcome Friend! Adding New Contacts Using the API</title>
		<link>http://brontoversity.com/2010/02/18/welcome-friend-adding-new-contacts-using-the-api/</link>
		<comments>http://brontoversity.com/2010/02/18/welcome-friend-adding-new-contacts-using-the-api/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 18:41:06 +0000</pubDate>
		<dc:creator>Andrew Kanes</dc:creator>
				<category><![CDATA[API Legacy Version 3]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[add contacts via API]]></category>
		<category><![CDATA[write contacts]]></category>

		<guid isPermaLink="false">http://brontoversity.com/?p=6260</guid>
		<description><![CDATA[
This post only applies to Legacy Version 3 of the API
You may be using the Bronto API to find out who is reading your deliveries or to send a message, but how about using it to add new contacts to your Bronto list? Using the API, you can add new contacts that you have in [...]


Related posts:<ol><li><a href='http://brontoversity.com/2010/01/12/importing-contacts-updating-existing-contacts-and-adding-new-contacts/' rel='bookmark' title='Permanent Link: Importing Contacts: Updating Existing Contacts And Adding New Contacts'>Importing Contacts: Updating Existing Contacts And Adding New Contacts</a> <small>Often times, when managing your Bronto contacts, you&#8217;ll want to...</small></li>
<li><a href='http://brontoversity.com/2009/09/24/spring-cleaning-clearing-contacts-from-lists/' rel='bookmark' title='Permanent Link: Spring Cleaning: Clearing Contacts From Lists'>Spring Cleaning: Clearing Contacts From Lists</a> <small>This post only applies to Legacy Version 3 of the...</small></li>
<li><a href='http://brontoversity.com/2010/05/13/personalize-your-contacts-storing-field-data-with-the-api/' rel='bookmark' title='Permanent Link: Personalize Your Contacts, Storing Field Data With The API'>Personalize Your Contacts, Storing Field Data With The API</a> <small>OK, so your integration is running. You&#8217;re adding contacts at...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img style="float: right; padding: 5px 5px 5px 5px;" src="http://brontoversity.com/wp-content/uploads/2010/02/welcome_car.jpg" alt="Waving" width="256" height="170" /></p>
<p><strong><span style="color: #ff0000;">This post only applies to Legacy Version 3 of the API</span></strong></p>
<p>You may be using the Bronto API to find out who is <a href="http://brontoversity.com/2009/08/27/who-loves-you/" target="_new">reading your deliveries</a> or to <a href="http://brontoversity.com/2009/07/30/washing-with-soap-part-3/" target="_new">send a message</a>, but how about using it to add new contacts to your Bronto list? Using the API, you can add new contacts that you have in a system outside of Bronto. The Bronto API allows you to create up to 1000 contacts in a single request. After the request has been successfully processed, these contacts will be available in the Bronto application and the API.</p>
<h3>Adding New Contacts</h3>
<p>You create these new contacts using the <a href="http://app.bronto.com/api/?q=v3_f_view&amp;fn=View&amp;id=100" target="_new"><code>writeContacts</code></a> function. This function allows you to give as much or as little information about the new contacts as you have. The only information required to create new contacts using <code>writeContacts</code> is their email address, their <a href="http://brontoversity.com/2009/06/23/whats-your-contacts-status/" target="_new"><code>status</code></a> (active, unsubscribed, bounced, unconfirmed), and whether each contact should receive html or plain text messages. Naturally, you can also include other information such as source, any lists the new contacts should be on, and any member field data you have about the new contacts. Since the email address is a unique identifier in the Bronto system, you will not create a duplicate contact should you try to create an email address that already exists. You can, however, update current contacts based on the email address if you choose.</p>
<h3>Advanced Features</h3>
<p>What if you don&#8217;t know if the contacts you are trying to add are all new? What if you don&#8217;t want to overwrite contact information already in Bronto? As part of your request, you can specify the mode that <code>writeContacts</code> should use. This tells the API how to handle this request. You can use <code>insert</code>, <code>update</code> or <code>insertUpdate</code>. If you specify <code>insert</code>, the contacts will only be created. If they already exist in Bronto, their information will not be updated or overwritten. The <code>update</code> mode will update information of current contacts. The last mode, <code>insertUpdate</code> will allow you to create new contacts or update contacts if they already exist.</p>
<p>The <code>listsMode</code> attribute of the <code>writeContacts</code> function gives you the ability  to add or remove the contacts from lists. The options for <code>listsMode</code> are <code>replace</code>, <code>insertUpdate</code> and <code>remove</code>. The <code>replace</code> mode removes the contacts from the lists they are currently on and adds them to the lists specified in the request. The <code>insertUpdate</code> mode keeps the contacts on any lists they may currently be on and adds them to the specified lists. The <code>remove</code> mode removes the contact from the lists in the request. You should always have a contact assigned to at least one list since you can only send to contacts on a list.</p>
<p>The <code>fieldsMode</code> allows you to specify how any member field data you send is treated. There are only two modes, <code>replace</code> and <code>insertUpdate</code>. The <code>replace</code> mode will delete any current field data the contact has, and add the field data sent in the request. The <code>insertUpdate</code> mode will only add data to a field if new field data is included in the request. It will leave any fields not specified in the request as they are.</p>
<p>Last but not least is the <code>ignoreStatusChangeIfUpdate</code> attribute. This parameter is really a safety net that keeps you from unintentionally changing the status of a contact. For instance, if a contact already exists in Bronto, but is bounced, this will keep you from accidentally updating them to subscribed and then attempting to send them a message. If you include this parameter with a value of 1 in your request, then a contact who is currently on your list will not have their status changed, regardless of what value you specify in the request.</p>
<h3>Some Example Code (PHP)</h3>
<p>Below is some example code you can use to get an idea of how the <code>writeContacts</code> function can be used.</p>
<div style="border: 1px solid; overflow: auto; height: 225px;"><code>/**<br />
* Creates a contact with the data provided here.<br />
*  This can easily be tied into a for loop to create many contacts at once.<br />
*/<br />
function writeContacts($binding) {<br />
// Initialize emtpy arrays<br />
$writeContact = $writeContactsHandler = array();<br />
// The email address to add<br />
$writeContact['email'] = 'user@yoursite.com';<br />
// Preference for type of message: text or html<br />
$writeContact['msgPref'] = 'html';<br />
// For status the choices are: active, unsubscribed, bounced, or unconfirmed<br />
// for a new contact, this should be 'active'<br />
$writeContact['status'] = 'active';<br />
// Where did this contact come from?<br />
$writeContact['customSource'] = 'signup during purchase';<br />
// insert, update, or insertUpdate, most of the time you want insertUpdate<br />
$writeContactsHandler['mode'] = 'insertUpdate';<br />
$parameters = array('contacts' =&gt; $writeContact, 'handler' =&gt; $writeContactsHandler);<br />
$result = $binding-&gt;writeContacts($parameters);<br />
return $result;<br />
}<br />
</code></div>
<h3>Add Away</h3>
<p>Now that you have read about the power of <code>writeContacts</code>, we hope you will continue to leverage the power of the Bronto API and discovery new ways to use it.</p>
<p><em>Andrew Kanes</em><br />
<em>Support Engineer at Bronto</em></p>


<p>Related posts:<ol><li><a href='http://brontoversity.com/2010/01/12/importing-contacts-updating-existing-contacts-and-adding-new-contacts/' rel='bookmark' title='Permanent Link: Importing Contacts: Updating Existing Contacts And Adding New Contacts'>Importing Contacts: Updating Existing Contacts And Adding New Contacts</a> <small>Often times, when managing your Bronto contacts, you&#8217;ll want to...</small></li>
<li><a href='http://brontoversity.com/2009/09/24/spring-cleaning-clearing-contacts-from-lists/' rel='bookmark' title='Permanent Link: Spring Cleaning: Clearing Contacts From Lists'>Spring Cleaning: Clearing Contacts From Lists</a> <small>This post only applies to Legacy Version 3 of the...</small></li>
<li><a href='http://brontoversity.com/2010/05/13/personalize-your-contacts-storing-field-data-with-the-api/' rel='bookmark' title='Permanent Link: Personalize Your Contacts, Storing Field Data With The API'>Personalize Your Contacts, Storing Field Data With The API</a> <small>OK, so your integration is running. You&#8217;re adding contacts at...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://brontoversity.com/2010/02/18/welcome-friend-adding-new-contacts-using-the-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
