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:
the error is on this line:
I hope your answers
Solved! Go to Solution.
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.
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.
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 firstname.lastname@example.org 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!
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:
How should we proceed?
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.
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:
If you have further issues after correcting this name, please let me know!
I am updating a campaign,after appending uploaded file url into existing email content. but on updating campaign Invalid Content error is coming.