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. |