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

Eric

Thanks for the info. Just

Thanks for the info. Just note that v4 wants a status of "unsub" instead of "unsubscribe" otherwise no matches are found.
John Gunther

Eric, Nice catch! Thanks for

Eric, Nice catch! Thanks for pointing this out. A correction has been made to the code example above.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>

More information about formatting options

CAPTCHA
Just checking to see if you're a human visitor. We don't like automated spam submissions.