Hi, I am trying to update contacts via the API this morning and am receiving a 500 error. I am able to grab contact data using the same url but when sending an update PUT request I get a 500 error in return
This is the error I get: The requested URL returned error: 500
Hello,
A 500 error can mean a few different things. Can you show us the XML that you are sending to the URL? Also the exact URL that you are doing the PUT call to. We should be able to troubleshoot exactly why you are getting this error.
Regards,
Here is the exact url I am submitting to: https://api.constantcontact.com/ws/customers/farmrichaccount/contacts/54077
and here is the XML:
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<link href="/ws/customers/farmrichaccount/contacts/54077" rel="edit"/>
<id>http://api.constantcontact.com/ws/customers/farmrichaccount/contacts/54077</id>
<title type="text">Contact: shea@scoutmarketing.net</title>
<updated>2010-12-20T16:00:50.118Z</updated>
<author>
<name>Constant Contact</name>
</author>
<content type="application/vnd.ctct+xml">
<Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/farmrichaccount/contacts/54077">
<Status>Active</Status>
<EmailAddress>shea@scoutmarketing.net</EmailAddress>
<EmailType>HTML</EmailType>
<Name> </Name>
<FirstName/>
<MiddleName/>
<LastName/>
<JobTitle/>
<CompanyName/>
<HomePhone/>
<WorkPhone/>
<Addr1/>
<Addr2/>
<Addr3/>
<City/>
<StateCode/>
<StateName/>
<CountryCode/>
<CountryName/>
<PostalCode/>
<SubPostalCode/>
<Note/>
<CustomField1><a href="http://bricks.coupons.com/enable.asp?</CustomField1>
<CustomField2>eb=1&o=82768&c=FR&p=54077&cpt=AOWwpYBzhi67moOWaHxd</CustomField2>
<CustomField3></CustomField3>
<CustomField4>"><img src="http://www.farmrich.com/email/</CustomField4>
<CustomField5>superbowl_2011/images/coupon.jpg" border="0" /></a></CustomField5>
<CustomField6/>
<CustomField7/>
<CustomField8/>
<CustomField9/>
<CustomField10/>
<CustomField11/>
<CustomField12/>
<CustomField13/>
<CustomField14/>
<CustomField15/>
<ContactLists>
<ContactList id="http://api.constantcontact.com/ws/customers/farmrichaccount/lists/39">
<link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/farmrichaccount/lists/39" rel="self"/>
<OptInSource>ACTION_BY_CUSTOMER</OptInSource>
<OptInTime>2010-12-20T16:00:50.220Z</OptInTime>
</ContactList>
</ContactLists>
<Confirmed>false</Confirmed>
<InsertTime>2010-12-20T16:00:50.118Z</InsertTime>
<LastUpdateTime>2010-12-20T16:00:50.118Z</LastUpdateTime>
</Contact>
</content>
<source>
<id>http://api.constantcontact.com/ws/customers/farmrichaccount/contacts</id>
<title type="text">Contacts for Customer: farmrichaccount</title>
<link href="contacts"/>
<link href="contacts" rel="self"/>
<author>
<name>farmrichaccount</name>
</author>
<updated>2011-02-02T16:39:08.124Z</updated>
</source>
</entry>
It looks like <CustomField5> is what is causing an error here. I'll need to do a bit more research, but a combination of the HTML encoded symbols at the end of the field combined with the stray quote after coupon.jpg are causing an issue when we try to read that field.
As a potential work around for the time being, if you were to split the fields into two separate custom fields such as:
<CustomField5>superbowl_2011/images/coupon.jpg"</CustomField5>
<CustomField6> border="0" /></a></CustomField6>
This would update fine and you would just need to include one extra field in order to complete your dynamic link.
David J
That worked. Thanks.
I am curious as to what the actual issue is though when you get it worked out.
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