200 OK, But blank response

Highlighted
Visitor

200 OK, But blank response

I'm trying to add a contact using the API, but when I submit an XHR request, it returns a 200 OK code, but the response is blank, and the contact is not added.

 

I'm posting to "https://api.constantcontact.com/ws/customers/MYACCOUNTHERE/contacts"

(I've replace my account name with MYACCOUNTHERE for this thread.)

 

What possibilities might lead to a blank response?

Tags (2)
3 REPLIES 3
Highlighted
CTCT Employee

Re: 200 OK, But blank response

Hi Amy,

 

Can you please provide us with the XML that you are using when you post.  If you are getting a 200 the contact should be hitting your account correctly.  I would suggest trying to do a GET to your contacts URI to see if the contact comes back as a result as well.

 

Also if you can give us the code where you are doing your Post so we can see if its submitting correctly.

 

Ryan Davis
Quality Engineer
Highlighted
Visitor

Re: 200 OK, But blank response

I got it working. 

 

The only change I made to the HXR request was that I changed the method from "PUT" to "POST", which makes sense REST-wise.  But I don't understand why the PUT (with "data:,none" in the <id> element of the XML) would return a 200 with no error feedback--it seems to me that it should return a message that PUT requires a Constant Contact ID.

Highlighted
CTCT Employee

Re: 200 OK, But blank response

I have researched your issue and found that when I do a PUT to the Contacts URI that I get a 415 which is a unsupported media type.  I am not sure why you are getting a 200 OK which is what you get when you do a GET instead of a Post. 

 

If you would like us to find out why you got a 200 please post your code.

Ryan Davis
Quality Engineer
Developer Portal

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