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.

The requested URL returned error: 400

Highlighted
Occasional Participant

The requested URL returned error: 400

Having trouble authenticating.   Think the root issue may be the logon(account) and password that I am using.    API Key doesn't seem to be the issue.    Are these meant to be the same as the logon and password used to enter the constant contact web application?   Or should I be using something different?


Patrick

 Patrick J. Flynn

3 REPLIES 3
Highlighted
Employee

re: 400 error

Hello Patrick,



The login for the API is the same as the Constant Contact username and password.  However, the login is the APIKey%loginname instead of just the login name alone.



I noticed that you put that you are getting a 400 error, not a 401. Usually if it is an authorization error it would be a 401 error. 400 errors are usually returned because of malformed XML. If the error you are receiving is 400, could you give us the XML that you are sending?



If you are still having an issue with authenticating, is it possible you can send your login name to the webservices support team, so that I can look into this further.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Highlighted
Occasional Participant

re: 400 error

Ben,


Thanks so much for your reply.   I'm including the XML that is getting generated/sent below. 


 


 


<entry>

<title>TitleNode</title>

<updated>2010-08-30T08:22:44+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>

Customer document

<EmailAddress>patrickjamesflynn@gmail.com</EmailAddress>

<FirstName/>

<LastName/>

<MiddleName/>

<CompanyName/>

<JobTitle/>

<OptInSource>ACTION_BY_CONTACT</OptInSource>

<HomePhone/>

<WorkPhone/>

<Addr1/>

<Addr2/>

<Addr3/>

<City/>

<StateCode/>

<StateName/>

<CountryCode/>

<PostalCode/>

<SubPostalCode/>

<Note/>

<EmailType/>

<ContactLists/>

</Contact>

</content>

</entry>

 Patrick J. Flynn

Highlighted
Employee

List not included

Hi Patrick,



It does not look you are including a Contact List URI when adding the contact.  Contact Lists are required when doing a POST to the Contact Collection.



If you have any questions please let me know.



Regards,

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
Featured