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.

Email Campaign Test Send API

Highlighted
Occasional Visitor

Email Campaign Test Send API

Hi All,

 

I am using following link and content to test the api

https://constantcontact.mashery.com/io-docs

 

i have given api key and token in the top

 

 

 

 

Request Body  { "format":"HTML_AND_TEXT",

"personal_message":"This is a test send of the email campaign message.",

"email_addresses":[ "address1@example.com",

"address2@example.com",

"address3@example.com"

,"address4@example.com",

"address5@example.com" ] }

 

 

getting error as follows

 

 

Response Body  [{ "error_key":"http.header.content_type.invalid",

"error_message":"Invalid content type. API only supports application/json." }]

 

please some one help as soon as possible.

5 REPLIES 5
Highlighted
Moderator

Re: Email Campaign Test Send API

The error means that there is an incorrectly set HTTP header from the request, specifically Content-Type: application/json.  All you will need to do is set the Content-Type header as described in our documentation here: http://developer.constantcontact.com/docs/developer-guides/general-considerations.html

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Visitor

Re: Email Campaign Test Send API

Thanks for your quick reply, I hope this will solve my problem.

 

Highlighted
Occasional Participant

Re: Email Campaign Test Send API

Hi 

 

A quick follow up on this. I've just started exploring CC integration and am new to the schemas. I ran into the same issue but aren't the request headers being generated via the Test call itself? I don't see the ability to change the header in the test page. If I try using my client, i get an authorization error. Can you please point me to the right doc / setup?

 

thanks

Highlighted
Moderator

Re: Email Campaign Test Send API

Thanks for pointing this out again.  We just updated I/O Docs and it should be all set now.  We had a configuration issue for the test send endpoint. 

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Participant

Re: Email Campaign Test Send API

Beautiful. Appreciate the quick turnaround. 

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