Reply
Occasional Visitor
JamesB72381
Posts: 2
Registered: ‎05-08-2011

Receiving 500 Error Code even though the operation worked

[ Edited ]

Hello,

 

I've been applying some updates to my drupal module and PHP code library (now using curl).

I have this working fine in drupal 7 but getting a weird error in drupal 6, both use the exact same code library.

 

I receive a 500 http error code when updating a contact even though the update is working, for example I'm updating the lists the contact is subscribed to and also have been removing all lists the contact is on, both work as when I check in constantcontact.com the changes reflect correctly however my app is always receiving the 500 error code, I've also checked this with a standalone rest tester tool and get the same response.

 

Example code below.

 

<entry xmlns="http://www.w3.org/2005/Atom">
  <id>http://api.constantcontact.com/ws/customers/*************/contacts/27</id>
  <title type="text">Contact: Tester123456@example.com</title>
  <updated>2008-04-25T19:29:06.096Z</updated>
  <author></author>
  <content type="application/vnd.ctct+xml">
    <Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers//*************//contacts/27">
      <EmailAddress>Tester123456@example.com</EmailAddress>
      <OptInSource>ACTION_BY_CONTACT</OptInSource>
      <OptInTime>2009-11-19T14:48:41.761Z</OptInTime>
<EmailType>Text</EmailType>
<ContactLists>
</ContactLists>
    </Contact>
  </content>
</entry>

 

 

Note that I'm using my test/trial CC account (not the one I'm logged in with now the other one ending in uk).

 

Can you help diagnose this please.

 

Thanks

James Benson

CTCT Employee
bsoder
Posts: 440
Registered: ‎06-05-2009

Re: Receiving 500 Error Code even though the operation worked

Hello James,

 

I took a look at your XML and I believe I found the problem.  I think it is actually a defect on our end that is giving a 500 error when you try to do an update to the contact with an upper case email address.  I did some testing and I am going to send this over to our engineers to look at and fix as soon as possible.  Also note that this only seems to be happening when you have the OptInSource to be set as ACTION_BY_CONTACT, if you do not have the opt in source, or have it set to ACTION_BY_CUSTOMER, your XML will succeed.

 

Currently the best way to work around it would be to force the email address to be lowercase before sending the PUT call.

 

If you have any questions please let me know.

 

Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Occasional Visitor
JamesB72381
Posts: 2
Registered: ‎05-08-2011

Re: Receiving 500 Error Code even though the operation worked

Thanks for the reply, I've modified my code to convert the email to lowercase and it works fine now.