- Constant Contact Community
- :
- Developer Community
- :
- Developer Support – ask questions, find answers
- :
- PHP Put Resubscribe Contact Status 400 Bad Request
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
PHP Put Resubscrib e Contact Status 400 Bad Request
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-24-2008 06:46 AM
I'm trying to 'put' back and resubscribe users to our list. I'm using a test email of mine for the time being, but keep getting a status 400 Bad Request.
Below is what I'm putting:
Update: Please see xml.txt attachment below. If someone could advise me how I can paste in XML code, I'd be very grateful :)
The headers I get back are:
(
=> 1.1
=> 400
=> 400 Bad Request
=> Mon, 24 Nov 2008 11:37:14 GMT
=> IBM_HTTP_Server
=> private, no-cache, no-cache="set-cookie,set-cookie2"
=> no-cache
=> close
=> chunked
=> text/html; charset=ISO-8859-1
=> en-US
)
I'm able to subscribe new contacts, and unsubscribe perfectly. It's just when I try and let people resubscribe, I have problems.
Not too sure how I post XML
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-24-2008 06:44 AM
RE: PHP Put Resubscrib e Contact Status 400 Bad Request
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-24-2008 07:51 PM
In your XML file try to change
<entry>
to: <entry xmlns="http://www.w3.org/2005/Atom">
and
ACTION_BY_CUSTOMER
to: ACTION_BY_CONTACT
So your Xml should look some thing like this
<entry xmlns="http://www.w3.org/2005/Atom">
<id>http://api.constantcontact.com/ws/customers/US
<title type="text">Contact: test@myemail.com</title>
<updated>2008-11-24T11:37:14.556Z</updated>
<content type="application/vnd.ctct+xml">
<Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/US
<EmailAddress>test@myemail.com</EmailAddress>
<OptInSource>ACTION_BY_CONTACT</OptInSource>
<ContactLists>
<ContactList id="http://api.constantcontact.com/ws/customers/US
</ContactLists>
</Contact>
</content>
<author> </author>
</entry>
If the contact you are trying to add is on the Do Not Mail List then
You can also "Remove" and Re-add Contacts. A contact that is Removed is valid in every way except they are not on any Contact Lists and thus they will not receive any emails.
To 'Remove' a contact, you simply update (PUT) their atom entry with an empty ContactLists tag.
They will not get any emails.
To 'Re-add' the contact, simply update (PUT) their entry back with the Contact List or Lists you want.
Mike C Support Engineer, Constant Contact


