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.

addsubscriber generates 400 error

Highlighted
New Member

addsubscriber generates 400 error

Hi I am getting a 400 error when i try and create a new subscriber: 


The xml I am generating is as follows:


<?xml version="1.0"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<title>TitleNode</title>
<updated>2010-03-31T15:13:46+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="http://ws.constantcontact.com/ns/1.0/">Customer document<EmailAddress>scott@aardvarkmedia.co.uk</EmailAddress><FirstName>Scott</FirstName><LastName>Normal</LastName><MiddleName></MiddleName><CompanyName></CompanyName><JobTitle></JobTitle><OptInSource>ACTION_BY_CONTACT</OptInSource><HomePhone></HomePhone><WorkPhone></WorkPhone><Addr1></Addr1><Addr2></Addr2><Addr3></Addr3><City></City><StateCode></StateCode><StateName></StateName><CountryCode></CountryCode><PostalCode></PostalCode><SubPostalCode></SubPostalCode><Note></Note><EmailType>html</EmailType><ContactLists><ContactList id="http://api.constantcontact.com/ws/customers/goedhuis88/lists/32"/><ContactList id="HK Web Clients"/></ContactLists></Contact></content></entry>

Please advise what may be causing the error


Thanks

1 REPLY 1
Highlighted
Employee

The 400 error you are

The 400 error you are recieving is due to your XML having an error in the list name:


1. The second Contact List id you are using (<ContactList id="HK Web Clients"/>) needs to be refrenced using that particular list id number, like you do for the first one (<ContactList id="http://api.constantcontact.com/ws/customers/goedhuis88/lists/32"/>)


 


I would recommend that you take a look at the Creating a Contact page, as this will show you the minimum XML required to create a contact, as well as how it should be formatted. I hope this helps. Please let us know if you have any other questions. Thanks!

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
Featured