Parting Is Such Sweet Sorrow
It's sad, but true. Occassionally, there are times when a contact may no longer want to receive your messages. Bronto handles these "unsubscribes" for you, but if you are using the Bronto API, you may need to transfer this information to your other systems for reference. You can do this using the readContacts function.
Getting All Unsubscribed
The easiest way to do this is simply retrieve all your contacts who are currently unsubscribed. This can be done by setting the filter in your readContacts function call to only return contacts who's status is equal to "unsubscribed". However, if you wanted to do this in an on-going fashion, you would be retrieving the same list of unsubscribed contacts with a few new unsubscribed contacts each time. You probably only want those contacts who have opted-out since you last retrieved that information.
Getting Recently Unsubscribed
To retrieve only those contacts who have recently unsubscribed, you would still want to set the filter to retrieve only those contacts who are unsubscribed. This time around though, you would want to add a type of "all" to the filter, and an additional criteria of modified date. The modified date would be the date and time of your most recent call to retrieve unsubscribed contacts. You would want everyone with a modified date that is greater than or equal to (GreaterThanEqualTo) the last time you performed this function. The SOAP message you generate to accomplish this should look something like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v4="http://api.bronto.com/v4">
<soapenv:Header>
<v4:sessionHeader>
<sessionId>YOUR SESSION ID</sessionId>
</v4:sessionHeader>
</soapenv:Header>
<soapenv:Body>
<v4:readContacts>
<filter>
<type>AND</type>
<status>unsub</status>
<modified>
<operator>GreaterThanEqualTo</operator>
<value>2010-12-14T12:15:00-04:00</value>
</modified>
</filter>
<pageNumber>1</pageNumber>
</v4:readContacts>
</soapenv:Body>
</soapenv:Envelope>With this information, you should be able to mirror the data you maintain about your contacts outside of Bronto with the information we keep for you. Please let us know if you have any questions.
Andrew Kanes
Support Engineer at Bronto


Comments
Thanks for the info. Just
Eric, Nice catch! Thanks for
Post new comment