Add contact to address book

The AddContactToAddressBook method is designed to add a single contact into an address book. It allows you to set information about the contact which you are uploading and specify the address book you are uploading them to.

This method is useful when you are building a newsletter signup or registration process when you also require the data to be used in another way (e.g. add the contact to a CRM system). If you just want to add a contact, then please review our "Contact Data Forms" feature within the app for a much easier approach. Any contacts added via this method will fire any join action that has been defined on an address book.


Guidance Notes

This method will create the contact required if it doesn't already exist within the dotMailer system. This means that calling a method such as CreateContact prior to the use of this method is unnecessary. If the contact does already exist within the dotMailer account we will assume that the information you are uploading is the most recent and therefore correct information. This means that we will overwrite any existing information associated with this contact in the dotMailer system with the information in this upload; even if it means the contact will have blank data associated with it.

If you are going to be uploading multiple contacts please use AddContactsToAddressBook or AddContactsToAddressBookWithProgress which allow you to upload multiple contacts in a single API call.


Parameters

username string This is the username from your API key. It is in the format of an email address and will look similar to apiuser-908709770324@apiconnector.com required
password string This is the password from your API key. required
contact contact This is the contact object; the only required property of the contact object is the email address. partially required
addressBookId int This is the ID of the address book that you wish to add the contact to. required

Return values

contact contact This is a contact object; it includes the generated ID.

Error responses

  • ERROR_ADDRESSBOOK_NOT_FOUND
  • ERROR_ADDRESSBOOK_NOTWRITABLE
  • ERROR_APIUSAGE_EXCEEDED
  • ERROR_CONTACT_INVALID
  • ERROR_CONTACT_SUPPRESSED
  • ERROR_CONTACT_TOOMANY
  • ERROR_DATAFIELD_NOTFOUND
  • ERROR_INVALID_EMAIL
  • ERROR_INVALID_LOGIN
  • ERROR_SYSTEM_SERVICETEMPORARILYUNAVAILABLE
  • ERROR_UNKNOWN

Request

Example of use in C#

Example of use in VB.NET

Example of use in PHP

Sample request

Sample response

Get started with dotMailer:

Small & Medium businesses Large businesses
Call the team on 0845 337 9170
What our clients say:

“dotMailer has changed our complete marketing process for the better. It's one of the easiest apps I have used and allows us to do things we have only dreamed of before."

Amberley Shermon, Cazenove+Loyd