Error 400: Invalid Content.(Create Campaign)

SOLVED
Highlighted
Occasional Contributor

Error 400: Invalid Content.(Create Campaign)

Hi,
We have successfully sent number of campaigns, but now we are getting the invalid content error while trying to create the following campaign (campaign data is on dropbox because message length limit):

 

https://www.dropbox.com/s/jmx84s7obcllw1k/EmailCampaign.txt

 

Note that successful and unsuccessful campaign only differs in the email content . Suspect some invalid char is causing problems, or is the size of the email maybe the problem?

 

Thanks in advance.

One more question (realted):

 

Is it possible to encode Xcontent in base64 as we already do for the Subject and FromName. To avoid escaping/encoding problems in future?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
CTCT Employee

Re: Error 400: Invalid Content.(Create Campaign)

Hi,

 

There is in fact a 150K character limit in custom code emails, and that appears to be what you are running into.  By my (text editor's) count, you have ~198K characters.  Our system will only know what to do with html encoded content for the email content (xcontent), so base64 encoding isn't an option.  Sorry for the limitation.

 

Best Regards,

Shannon W.

API Support Specialist

View solution in original post

3 REPLIES 3
Highlighted
CTCT Employee

Re: Error 400: Invalid Content.(Create Campaign)

Hi,

 

There is in fact a 150K character limit in custom code emails, and that appears to be what you are running into.  By my (text editor's) count, you have ~198K characters.  Our system will only know what to do with html encoded content for the email content (xcontent), so base64 encoding isn't an option.  Sorry for the limitation.

 

Best Regards,

Shannon W.

API Support Specialist

View solution in original post

Highlighted
Occasional Contributor

Re: Error 400: Invalid Content.(Create Campaign)

Ok, thank you :)


One more related question: How characters are counted?


We are programmatically creating xcontent via your api. Prior to send create campaign command, xcontent is encoded.

 

For example “&” is encoded as “&” Is this counted as 1 char or 5 chars?

 

Tnaks in advance

Highlighted
CTCT Employee

Re: Error 400: Invalid Content.(Create Campaign)

Good question, I thought about mentioning that as a side note.  The character count is calculated AFTER encoding, meaning & does count as 5 characters toward the 150K character limit.

Developer Portal

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