Updating a User

ddevault
Occasional Participant

Updating a User

Hello,

I am using C#, and I PUT the following XML to https://api.constantcontact.com/ws/customers/ddevault/contacts/2


<entry xmlns="http://www.w3.org/2005/Atom"><id>data:,none</id><title type="text">Contact: test@test.com</title><summary type="text">Contact</summary><updated>2010-06-03T13:24:32-06:00</updated><author /><link href="https://api.constantcontact.com/ws/customers/ddevault/contacts/2" /><content type="application/vnd.ctct+xml">

<Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="https://api.constantcontact.com/ws/customers/ddevault/contacts/2">

<Status>Active</Status>

<EmailAddress>test@test.com</EmailAddress>

<EmailType></EmailType>

<Name>Joe Bloe</Name>

<FirstName>Joe</FirstName>

<MiddleName></MiddleName>

<LastName>Bloe</LastName>

<JobTitle></JobTitle>

<CompanyName></CompanyName>

<HomePhone></HomePhone>

<WorkPhone></WorkPhone>

<Addr1></Addr1>

<Addr2></Addr2>

<Addr3></Addr3>

<City></City>

<StateCode>NY</StateCode>

<StateName>New York</StateName>

<CountryCode>US</CountryCode>

<CountryName>United States</CountryName>

<PostalCode>80920</PostalCode>

<SubPostalCode></SubPostalCode>

<Note></Note>

<CustomField1></CustomField1>

<CustomField2></CustomField2>

<CustomField3></CustomField3>

<CustomField4></CustomField4>

<CustomField5></CustomField5>

<CustomField6></CustomField6>

<CustomField7></CustomField7>

<CustomField8></CustomField8>

<CustomField9></CustomField9>

<CustomField10></CustomField10>

<CustomField11></CustomField11>

<CustomField12></CustomField12>

<CustomField13></CustomField13>

<CustomField14></CustomField14>

<CustomField15>test</CustomField15>

<OptInSource>ACTION_BY_CONTACT</OptInSource>

<ContactLists >

        <ContactList id="http://api.constantcontact.com/ws/customers/ddevault/lists/5">

          <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/ddevault/lists/5" rel="self"></link>

          <OptInSource>ACTION_BY_CONTACT</OptInSource>

          <OptInTime>2010-06-03T17:53:11.906Z</OptInTime>

        </ContactList>

     

</ContactLists>

<Confirmed>false</Confirmed>

<InsertTime>2010-24-03T01:24:32.474Z</InsertTime>

<LastUpdateTime>0001-00-01T12:00:00.000Z</LastUpdateTime>

</Contact></content></entry>


 


However, I get a 409 Conflict error.  Both the user and the list exist, and the only changing information is the state they are from, changing from CO \ Colorado to NY \ New York.


 


Thoughts?

2 REPLIES 2
DaveBerard
Moderator

Looks like the cause is your id field in the XML.  You are using the following ID value:


 


https://api.constantcontact.com/ws/customers/ddevault/contacts/2


 


However, all id values are set up using http:// not https://.  This is due to a change we made from our original requests that were all in http to processing them over https for security purposes.  We chose to leave the ID as http as it really has no bearing on how to process ATOM requests and was already unique.  Change your ID to:


 


http://api.constantcontact.com/ws/customers/ddevault/contacts/2

Dave Berard
Senior Product Manager, Constant Contact
ddevault
Occasional Participant

It works great now, thanks!

Developer Portal

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

Visit Page