Add contacts to address book with progress

The AddContactsToAddressBookWithProgress method allows you to add multiple contacts to an address book within the dotMailer system. It allows you to track the progress of the import by returning a GUID which you can use to query the import progress.

This method is useful when you need to upload multiple contacts in one go into the dotMailer system. As each call only counts as one API call it allows you to easily stay below your API limit whilst uploading multiple contacts. It has the benefit of being run through our data watchdog so you know the data you are importing is of a good quality.

It will return a GUID which you can use to check the progress of your import. This is useful if you want to perform an action on the address book when the import has finished.


Guidance Notes

This method will create the contact being added if it doesn't already exist which means you do not need to call a method such as CreateContact before calling it. You may upload either a .csv or .xls file. It must contain one column with the heading "Email" or the translated equivalent if your account is using a language other than English. Other columns will attempt to map to your custom data fields. There is a 10MB file upload limit; if your file is larger than this, please break your upload into separate files.

As the import goes through our data watchdog there might be a delay between uploading the contacts and them being successfully added to the address book.

To query the progress of the import please call GetContactImportProgress using the GUID returned by AddContactsToAddressBookWithProgress.


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
addressBookId int This is the ID of the address book which you would like to upload the contacts to. required
data base64Binary This is the original file, encoded in Base64 format. required
dataType CSV or XLS This is the type of file which you are uploading, either .CSV, or .XLS. At this time, XLSX is not supported. required

Return values

progressid guid The guid used to call GetContactImportProgress

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_IMPORT_TOOMANYACTIVEIMPORTS
  • ERROR_INVALID_LOGIN
  • ERROR_NO_EMAIL_COLUMN
  • ERROR_PARAMETER_INVALID
  • ERROR_SYSTEM_SERVICETEMPORARILYUNAVAILABLE
  • ERROR_UNKNOWN

Request

Example of use in C#

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