I'm trying to add contacts to a new list.. I get this on all the contacts.
The contacts may have been in other lists, too...
How do I add contacts to mulitple lists.... can you add contacts to more than one list?
In order to change information about a contact that is already in the account, you would need to do a PUT call on their contact URI, the the contacts current Contact XML and the changes that you would like to make.
So to add a customer to a new list, you would want to do a GET on the contacts URI, which can be found by doing a search for the contact by email address. Once you receive the ID, you would want to do a GET call, which will retrieve the contacts XML. Using the XML you will want to add or remove the contact list that you are trying to change, and then do a PUT call back to the contact ID with the new xml.
You can find out more about this process here. If you have any further questions please let me know.
Can a contact be in multiple lists?
I want Bob Smith in my Seminars List and Training List.
I'm using the .Net lib. How do I add Bob Smith if he already exists in another list?
Yes a contact can be on multiple lists. The way this works in the API is that you would have more lists added to the <ContactLists> node. When using the library, you would want to first search to see if the contact already exists using the SearchContactByEmail() function. If the contact exists, you would then want to create an object of the contact using the GetContactDetailsById() function, with the Contact ID that you would get from the previous function. You would want to add the new list to this object, and then update it back into our system with the UpdateContact() function.
You mean Utility.UpdateContactFullForm... to UpdateContact() ??
So I have to something like this...
string _nextChunkId;IList<Contact> lstContant = Utility.SearchContactByEmail(Get_Authentication(),emails,out _nextChunkId);if (lstContant.Count>0)Contact c = Utility.GetContactDetailsById(Get_Authentication(),lstContant.Id);ContactOptInList cl = new ContactOptInList();ContactOptSource.ActionByContact;new ConstantContactBO.ContactList(ID);Utility.UpdateContactFullForm(Get_Authentication(), c);else // NEW CONTACT Contact c = new Contact(dr.ToString(), dr.ToString(), dr.ToString());
I believe what you're looking to do would be similar to what I have below. This would add the contact if they do not exist, otherwise this would update the existing contact w/ the new Contact List.
I hope this helps. Please let me know if you are running into any difficulties with this or have any other questions. Thanks!
View API documentation, code samples, get your API key.Visit Page
The holidays have come and gone. For many seasonal businesses, this means the rush of shoppers has decreased as well. Instead of turning off the lights and waiting for spring, make your email marketi...See Article