The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

400 Error using PHP API examples

New Member

400 Error using PHP API examples


oddly CC support doesn't help out with the API and they've sent me here...

I'm using the sample PHP code from cc_class.php to generate XML to send to CC server. Curl tells me that the response is a 400 error. I am sending the following XML when I get the error:


<?xml version="1.0" encoding="UTF-8"?>

<entry xmlns="">




        <name>CTCT Samples</name>



    <summary type="text">Customer document</summary>

    <content type="application/vnd.ctct+xml">

        <Contact xmlns="">

            Customer document


























                <ContactList id="2" />






in CC_Utility I have my CC username, the password I use to log in to the CC main site, and an API key that I generated.


What am I doing wrong?



Thanks for any help

Tom Lancaster


New Member

nevermind - fixed it

nevermind - as often happens, the act of asking the question has turned a lightbulb on.

The contactlist "id" is not actually the list id. It's the list uri: ''

Better nomenclature might have prevented that misunderstanding, but at least it's working now.

Tom Lancaster



Re: nevermind - fixed it

I apologize for any inconvenience that this issue has caused. We do have this documented in Creating a Contact, but I can see how this would be confusing and I do apologize for that. I am glad that you were able to resolve this issue however.

I do want to comment on CTCT Support sending you here. Our phone/chat support channels are meant for support with our actual user interface, and not meant to be developer/API support. With that being said, we do have support representatives that handle API related issues from either this forum, or by emailing our webservices support team. If you contact us by these channels, we will be more than happy to assist you with integration questions. If you do have any other questions please do not hesitate to let us know. Thank you.

David J

Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More