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.

getting 400 error on adding contact by api (PHP)

New Member

getting 400 error on adding contact by api (PHP)

When i try to add email address by api code i got below error :


The requested URL returned error: 400

Below is my post xml format :


<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns=""><title>TitleNode</title><updated>2011-07-07T09:22:50+01:00</updated><author><name>CTCT Samples</name></author><id>urn:uuid:E8553C09F4xcvxCCC53F481214230867087</id><summary type="text">Customer document</summary><content type="application/vnd.ctct+xml"><Contact xmlns="">Customer document<EmailAddress></EmailAddress><FirstName></FirstName><LastName></LastName><MiddleName></MiddleName><CompanyName></CompanyName><JobTitle></JobTitle><OptInSource>ACTION_BY_CUSTOMER</OptInSource><HomePhone></HomePhone><WorkPhone></WorkPhone><Addr1></Addr1><Addr2></Addr2><Addr3></Addr3><City></City><StateCode></StateCode><StateName></StateName><CountryCode>US</CountryCode><PostalCode></PostalCode><SubPostalCode></SubPostalCode><Note></Note><EmailType>HTML</EmailType><ContactLists/></Contact></content></entry>

Please Help Me :(





Re: getting 400 error on adding contact by api (PHP)



I believe the reason you are receiving this 400 error is due to not having any contact lists listed in the XML.  When creating a new contact in the API, you must add the contact to at least one valid contact list.


If you have any questions please let me know!



Benjamin Soder
NOC Analyst
Constant Contact
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