Showing results for 
Search instead for 
Did you mean: 
Due to an issue with YouTube, inserting videos in your emails is showing an error. Until they are able to resolve this issue, we recommend using a different video hosting service. We will continue to monitor this outage and update you as we have more information.

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 :(




CTCT Employee

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