cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid Content Error

SOLVED
Occasional Contributor

Invalid Content Error

Good morning

I work with a web service with c # api until some time ago it was working fine, now has this problem to create campaigns:

http.status.bad_request: Invalid Content.

The contact list is loaded; but the campaign is never created.

Sending this data:

cc_error.jpg

 

the error is on this line:

 

cc_error2.jpg

 

I hope your answers

Thanks.

 

12 REPLIES 12
Honored Contributor

Re: Invalid Content Error

Hello,

 

With the campaign you are trying to create, are you setting the EmailContentFormat as HTML or XHTML? With standard HTML emails this should be functional, but if you are choosing XHTML then there is a <text> XHTML element that is expected in the text version of the campaign.

 

For XHTML the TextContent would want to have the following content:

<text>Testing from web service</text>

One additional piece of information that would help is to get a visual of all of the properties of the EmailCampaign that is being sent. That would help me to identify exactly what is happening.

 

Sincerely,

Elijah G.
API Support Engineer
Occasional Contributor

Re: Invalid Content Error

Hi,

Well we are using HTML as the content Format.

But I want to highlight that it was working just fine until a couple of weeks ago. No changes were done on our side and all of a sudden it stopped to work and that is the Error that I received now.

 

So I am sending you the Object’s content with all its Properties, as detailed as possible.

issueCC.jpg

Honored Contributor

Re: Invalid Content Error

Hello,

 

After looking at this deeper and even re-creating your campaign contents in my own account, I was not able to re-create the issue that you've experienced. After reviewing the code that is used to validate this, it does appear that somehow the actual HTML content that is being sent is causing this 400 invalid content issue.

 

Would it be possible for you to email us at webservices@constantcontact.com with the code that you use to create this campaign object? If I was able to get that snippet of the code that I could implement in the C# SDK, that should give me enough to be able to replicate this issue. Once I can replicate it, I will then be able to quickly identify for you what the cause is for this issue.

 

Please let me know if you have any questions!

 

Sincerely,

Elijah G.
API Support Engineer
Occasional Contributor

Re: Invalid Content Error

We are not successful on fixing the issue, so let us go through the steps we did and let us know what you propose please:

  1. our service executes a couple of steps in order to create the campaign: creates the list, adds the contacts to the list, ….. , adds the campaign, schedules the campaign.
  2. All of a sudden, a specific step stopped working: adding the Campaign
  3. The error: bad_request:Invalid Content.
  4. No modifications were done on our end for this to happen
  5. We sent you our code and you said all is OK, our code works fine.

SO

  1. We created a Trial
  2. Use the exact SAME CODE (instead of bulk methods used the simple ones, cause bulks don’t work in trial accounts)
  3. Works OK for the Trial account, no errors no warnings nor nothing the campaign gets created correctly
  4. Keeps on FAILING for our account

How should we proceed?

Occasional Contributor

Re: Invalid Content Error

Any update to help please?

Honored Contributor

Re: Invalid Content Error

Hello,

 

My apologies for the delay! I have been doing a deep dive on this, and while I do have some clues about the cause, I have not yet been able to identify a method that we can use to correct the problems that you are seeing.I will be continuing to research this issue today and I hope to have an update by tomorrow for you.

 

Sincerely,

Elijah G.
API Support Engineer
Honored Contributor

Re: Invalid Content Error

Hello,

 

After some additional research, I was able to find a way to resolve the issue for you! While looking into your account, I noticed that one of the custom fields in your account is specifically named "null". This naming of the custom field causes a hiccup with some code related to our Custom Code emails.

 

While we will definitely be looking into how we can correct this issue long-term, the best short-term solution is to simply rename your custom field so that it is something other than "null". For more information on renaming custom fields, you can read this article:

https://knowledgebase.constantcontact.com/articles/KnowledgeBase/5328-add-and-manage-custom-fields

 

If you have further issues after correcting this name, please let me know!

 

Sincerely,

Elijah G.
API Support Engineer
Occasional Contributor

Re: Invalid Content Error

 

Thank you very much! that was the issue,
the problem has been solved and all is working just fine.
Regular Visitor

Re: Invalid Content Error

 

I am updating a campaign,after appending uploaded file url into existing email content. but on updating campaign Invalid Content error is coming.