Update Contact in .Net

Regular Participant

Update Contact in .Net

Is there a simple example of how to update a contact's data using .Net? I have the Contact ID and the URI https://api.constantcontact.com/ws/customers/{username}/contacts/{contact-id}

Do I need to write the entire XML content to the WebRequest stream? Just the "Contact" node?


The easiest way to update a contact, especially in .NET, is to run a GET on your contact, load it into an XML structure (such as XmlDocument in .NET) and modify/update information.  You can than convert this back to an XML string (such as the OuterXml property) and send it back to us.  This is the easiest method I've found in my .NET work.

Dave Berard
Senior Product Manager, Constant Contact
Regular Participant

Thanks for the info Dave,

Is there a place on this site that defines what XML structures need to be passed in? I manged to get the Contact to update but now I'm having an error with ContactList. Is this the structure I want to send in for ContactList to update it?


<feed xmlns='http://www.w3.org/2005/Atom'>


  <title type='text'>Contact Lists</title>


    <name>Constant Contact</name>






    <ShortName>Default Customers</ShortName>






There is a full breakdown of the required and optional fields for each collection here.  We also have sample XML up there as well for all the different request types.

For example, here is the XML document for creating a list:

<entry xmlns="http://www.w3.org/2005/Atom">





  <content type="application/vnd.ctct+xml">

    <ContactList xmlns="http://ws.constantcontact.com/ns/1.0/">


      <Name>A New List</Name>







Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

View API documentation, code samples, get your API key.

Visit Page