This tutorial is intended for view on larger devices.
This tutorial walks you through the API calls related to adding new contacts and/or updating existing contacts. While the steps in the tutorial are presented in a logical order, it is not strictly required that you follow each step as it is presented.
Authenticate With Bronto
Before you can login using the API, you need to log into Bronto and set up your authentication and API access tokens. To do this:
Create API Session
Use the access token you created to log in. The session ID created when you log into the API will expire if there is no transaction for a 20 minute period.
Create Contact Fields
Before you add new contacts, you need to make sure any fields associated with the contacts exist in Bronto. First, check to see if the fields exist. If a field does not exist, create it. This will allow Bronto to map and fields contained in the fields array for your contacts to the appropriate Bronto field.
Add A New Contact
The addOrUpdateContacts call can be used to add a new contact. Make sure to specify the related contact fields in the array. If the contact is new or already exists, you will get back an ID.
When the contact is being added with addOrUpdateContacts, the contact status is set to onboarding by default. This status allows the contact to receive promotional emails. The status will change to Active automatically in Bronto after the contact completes onboarding.
If you want to associate a new contact with a list, that list needs to exist in Bronto. If your lists already exist you can skip this step.
Update An Existing New Contact
The addOrUpdateContacts call can also be used to update an existing contact.
If you get back the error code 315 with the associated message “EMAIL_SUPPRESSED” in the result array when updating a contact, the contact is on the suppression list. If the contact is on the suppression list, you will not be able to update the contact status, with the addOrUpdateContacts call, and the contact will never receive any email, including transactional emails. To remove a contact from the suppression list, you will have to log in to Bronto and manually remove the contact from the suppression list.
Update A Contact’s List Membership
One of the updates you can make to an existing contact is to change the contact’s list membership. First, you need to retrieve the list ID. Once you have the list ID you can use the addOrUpdateContacts call to add a contact to a list.
You also have the option of using the addToList function to add one or more contacts to a list. When you use addTOList, you are limited to adding 5k contacts per call.
Update A Contact’s Field Data
Another common change made to existing contacts is to update the contact’s field data. If you want to update a field itself, you should use the updateFields call instead.