email_content error in API


email_content error in API



has anyone seen error

[error_key] => json.invalid.value.no_script_tags

[error_message] => #/email_content: Field does not support script content. 


when sending HTML email through API?


My HTML code doesn't have any javascripts in it if that' what they refer to. My code works fine with really simple hello world HTML code, but as soon as I get to the real one, getting this error.


On that note, a better system than these forums, or at least a dedicated forum itself, needs to be implemented to flag specific email_content validation issues. 

I completely agree with your feedback on both points. 


1. Error Messages: we are looking into how to provide better, more detailed error messaging without allowing malicious people to take advantage of this and exploit our system.  Hopefully we'll have some updates on this soon. 


2. Better defect/issue tracking: we're working on a project right now to improve both visibility into our API performance (uptime, latency, availability,etc.) as well as an improve issue tracking and defect monitoring solution.  We're hopeful to have the first pieces of that system out before the end of the year with more improvements to come on that front.  Definitely agree, the forum is useful for troubleshooting code issues but not overly affective in defect tracking at all. 

Dave Berard
Senior Product Manager, Constant Contact
Occasional Participant

Hi, I have read all of these comments. I was triyng to use yuor API but your HTML filtering or validator or whatever you use is poorly programmed, errors are not clear and not even using to validate my code and then use your API I can't pass your filter.


For example, this simple code:


<html><head><title>Boletin</tiltle></head><body><table width="700"><tr><td>horrible API filter</td></tr></table></body></html>


I got the error:

[error_key] => json.invalid.value.no_script_tags
            [error_message] => #/email_content: Field does not support script content.


All is because of this simple property: width="700"


if I use:

width=\'700\' or width=\"700\" instead of width="700", it does not work neither.

Can you please tell me how to fix this? I got all my code ready to send newsletter to 8000 contacts, why you just don't use the same filter you have on your website tool (Own Code), i don't have problems there, but i need to send multiple newsletter, that's why I need the API.

When are we going to have a real validator? thi is urgent for my enterpresi, and I really don't want to move from Constant Contact, but my boss has less patience than me. 


Regular Participant

This error can be very frustrating as it offers no feedback what so ever! Why can I create a new email campaign by pasting in html into the advanced editor on the constant contact system, but when I try creating a new campaign with the same HTML via the API/SDK I recieve this error.

Why can't this HTML run through the same validator it does if in the advanced editor? It's very inconvenient creating a new campaign on Constant Contact and then not being able to modify any aspect of that campaign in my API integration as HTML doesn't validate although the advanced editor has not issues with it.

I completely agree with AdamS700. It's frustrating that there's no way to determine the specific element causing the problem. 


If you're going to perform validation or filtering of the HTML we're submitting (which is understandable), you absolutely need to provide either the specifics of what you're validating against, or a tool for us to use outside of the API to manually validate our HTML and point out any speficic issues.

Developer Portal

View API documentation, code samples, get your API key.

Visit Page