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.

400: Bad Request received when posting campaign

Highlighted
Occasional Contributor

400: Bad Request received when posting campaign

Hello,

 

I am using a c# application to send campaigns. I am trying to upgrade the project to API v2, but am having some problems. When I make a request to create a new campaign, I am getting a 400: Bad Request error. From what I have seen around the net, it is most likely a JSON syntax error, but I have checked my syntax and it seems fine. I am using the exact same format given in one of the examples. Also, my api key and access token work in the Test API/Mashery part of your site.

 

Here is my request call:

https://api.constantcontact.com/v2/emailmarketing/campaigns?api_key={ApiKeyHere}

 

Here is the JSON string:

{"name": "TestCampaignByPaul","subject": "Test Email","from_name": "Paul Aldrich","from_email": "paldrich@abdata.com","reply_to_email": "paldrich@abdata.com","is_permission_reminder_enabled": true,"permission_reminder_text": "This is your permission reminder.","is_view_as_webpage_enabled": false,"greeting_salutations": "Hello","greeting_name": "FIRST_NAME","greeting_string": "Dear ","email_content": "<html<body><p>This email is a test. Please disregard.</p></body></html>","text_content": "This is the text-only content.","email_content_format": "HTML","style_sheet": "","message_footer": {"organization_name": "My Organization","address_line_1": "123 Maple Street","address_line_2": "Suite 1","address_line_3": "","city": "Anytown","state": "MA","international_state": "","postal_code": "01444","country": "US","include_forward_email": false,"include_subscribe_link": false }"sent_to_contact_lists": {"id": "3" }}

 

Here is the code to POST the campaign:

 

string responseFromServer = string.Empty;
string dataToRead = string.Empty;
if (xmlDoc == null) dataToRead = postData;
else dataToRead = xmlDoc.OuterXml;
WebRequest request = WebRequest.Create(requestCall);
request.Method = "POST";

byte[] byteArray = Encoding.UTF8.GetBytes(dataToRead);
string authHeader = string.Format("Bearer {0}", ConfigurationManager.AppSettings["APIv2AccessToken"].ToString());
request.Headers.Add("Authorization", authHeader);
request.Headers.Add(HttpRequestHeader.ContentType.ToString(), "application/json");

request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
using (WebResponse response = request.GetResponse())
{
Console.WriteLine(((HttpWebResponse)response).StatusDescription);
dataStream = response.GetResponseStream();
using (StreamReader reader = new StreamReader(dataStream))
{
responseFromServer = reader.ReadToEnd();
}
}
dataStream.Close();
return responseFromServer;

 

Please advise. Thanks.

-Paul

4 REPLIES 4
Highlighted
Moderator

Re: 400: Bad Request received when posting campaign

Hi Paul,

 

When you are doing a POST or PUT and receive a 400 Bad Request error, it is accompanied by a full body error message detailing the exact cause of the 400 error.  Here is an example of the error:

 

[ {
  "error_key" : "http.status.bad_request",
  "error_message" : "Please enter a valid email address."
} ]

 

Your specific error seems to be that your JSON is not valid.  When I run it through a JSON validator, it throws an error saying that the JSON is invalid after the message_footer object.  There is a comma missing from there.  You can use this free JSON validator here to test your JSON: http://jsonlint.com/

 

Also, your send_to_contact_lists node is required to be an array, you have it as an object.  This will cause a failure for validation.  You can find out more about the valid format for our Email Campaign here: http://developer.constantcontact.com/docs/email-campaigns/email-campaign-resource.html

 

I'm not sure if you looked into this or not as well, we have a full C# wrapper that does all of the HTTP requests, JSON parsing and object generation for you.  Since you already have your OAuth 2.0 Access Token, it is really easy to get up and started with the C# wrapper (simply set the access token on instantiation).  You can find the wrapper here: https://github.com/constantcontact/.net-sdk. If you've already looked at this and decided not to use it, please feel free to give feedback so we can keep making the wrapper better for future developers.

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Contributor

Re: 400: Bad Request received when posting campaign

Hi Dave,

 

Thanks for the reply. I had to make several fixes to the JSON (the two you mentioned, plus my html tag was missing a >). and that fixed it. Thanks for the validator link, it should be helpful.

 

I've seen the CTCT Wrapper before. I don't think we really need it, but thanks for the tip.

 

-Paul

Highlighted
Occasional Contributor

Re: 400: Bad Request received when posting campaign

Argh; I'm looking for an edit button and not finding one. Anyhow, I have a new problem that is related to this. There seems to be a problem with the HTML in my payload; it is returning a 400 Bad Request error. The specific error text is:

 

[{"error_key":"json.payload.contains_invalid_characters","error_message":"The request contains text outside character set ISO-8859-1."}]

 

 

My payload is below, but I'm guessing it won't help (who has time to go through that?). I'm escaping double quotes, but I think the unicode characters are screwing it up (stuff like прессъобщения; we pull news from everywhere, so we need to have unicode in our newsletter). When running it through the JSONLint checker, it gives the following error message:

 

Parse error on line 17:
...   "email_content": "<html xmlns=\"http:
-----------------------^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['

 

However, it's pointing at the " before the <html xmlns... which is not the actual problem, because when I remove everything inside the <html>, it says the JSON is valid. 

 

Any ideas what I can try?

 

EDIT: I have updated my payload - it had some invalid characters (i.e. …, –) which I have replaced with normal characters. I have also replaced all new lines. However, same error.

 

JSON Payload (Updated)

 

{"name":"Class Action News","subject":"Class Action News - Provided by A.B. Data, Ltd.","from_name":"A.B. Data, Ltd.","from_email":"info@abdatanews.com","reply_to_email":"info@abdatanews.com","text_content":"Today's Class Action News","email_content_format":"HTML","message_footer":{"OrganizationName":"A.B. Data, Ltd.","AddressLine1":"600 A B Data Drive","City":"Milwaukee","State":"WI","PostalCode":"53217","Country":"USA"}, "email_content": "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head>    <title></title></head><body>    <table style=\"padding: 0px; margin: 0px; text-align: center; background-color: #FFFFFF;        font-family: Arial; width: 100%;\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"        align=\"center\">        <tbody>            <tr>                <td>                    <table cellpadding=\"0\" cellspacing=\"0\" style=\"background-color: #FFFFFF;\">                        <tbody>                            <tr>                                <td style=\"width: 73px; background-color: #d52b1e;\" width=\"73px\">                                </td>                                <td style=\"width: 7px;\" width=\"7px\">                                                                     </td>                                <td width=\"579px\" style=\"width: 579px; vertical-align: bottom;\" valign=\"bottom\">                                    <p style=\"font-family: Arial; font-size: 16pt; color: #3c3c3c; text-align: left;                                        margin: 0px 0px 0px 8px;\">                                        CLASS ACTION ADMINISTRATION</p>                                </td>                            </tr>                            <tr>                                <td style=\"width: 73px; vertical-align: top;\" width=\"73px\">                                    <a href=\"http://www.abdataclassaction.com\">                                        <img src=\"http://www.abdataclassaction.com/Newsletters/Images/logo_nb.gif\" alt=\"A.B. Data, Ltd. :: Logo\"                                            border=\"0\" height=\"106px\" width=\"73px\" /></a>                                </td>                                <td style=\"width: 7px;\" width=\"73px\">                                                                     </td>                                <td width=\"579px\" style=\"width: 579px; background-color: #ebebeb; text-align: center;\"                                    align=\"center\">                                    <img src=\"http://www.abdataclassaction.com/Newsletters/Images/lp_small.jpg\" alt=\"A.B. Data, Ltd. :: Logo\"                                        border=\"0\" height=\"123px\" width=\"579px\" />                                </td>                            </tr>                            <tr>                                <td style=\"width: 73px; background-color: #3c3c3c; text-align: center;\" align=\"center\"                                    width=\"73px\">                                    <a style=\"font-family: Arial; font-size: 12pt; color: #FFFFFF;\" href=\"http://abdataclassaction.com/Retain.aspx\">                                        Retain</a>                                </td>                                <td style=\"width: 7px; background-color: #3c3c3c;\" width=\"7px\">                                                                     </td>                                <td width=\"579px\" style=\"border-width: 0px; vertical-align: top; width: 579px;\" valign=\"top\">                                    <p style=\"padding: 5px; margin: 0px; background-color: #3c3c3c; font-family: Arial;                                        font-size: 18pt; color: #FFFFFF; text-align: center; vertical-align: top; font-weight: bold;\">                                        CLASS ACTION NEWS</p>                                </td>                            </tr>                            <tr>                                <td style=\"width: 73px; vertical-align: top;\" width=\"73px\">                                                                     </td>                                <td style=\"width: 7px;\" width=\"7px\">                                                                     </td>                                <td width=\"579px\" style=\"background-color: #ebebeb; text-align: left; vertical-align: top;                                    width: 579px;\" valign=\"top\">                                    <table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://online.wsj.com/article/PR-CO-20140113-909030.html\"><b>Pomerantz Law Firm Has Filed a <b>Class Action</b> Against INTL FCStone, Inc. and <b>...</b></b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">Wall Street Journal</font></b></font><br /><font size=\"-1\">The <b>class action</b>, filed in United States District Court, Southern District of New York, and docketed under 14-cv-232, is on behalf of a class consisting of all persons or entities who purchased or otherwise acquired securities of INTL FCStone between <b>...</b></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=drKjfPBeyXHE41M&amp;authuser=0&amp;ned=us\"><nobr><b>and more&nbsp;&raquo;</b></nobr></a></font></div></font></td></tr></table><table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://www.wwnytv.com/news/local/Stewarts-Shops-Faces-Class-Action-Lawsuit-239985071.html\"><b>Stewa... Shops Faces <b>Class Action</b> Lawsuit</b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">WWNY TV 7</font></b></font><br /><font size=\"-1\">The <b>class action</b> lawsuit also alleges that Stewart&#39;s Shops routinely deprived employees of mandatory meal breaks; failed to implement an accurate and effective method to record time worked by employees; failed to provide employees with mandatory&nbsp;<b>...</b></font><br /><font size=\"-1\"><a href=\"http://www.csnews.com/top-story-in_the_courts-c51-stewart_s_shops_faces_class_action_lawsuit_over_wa... Shops Faces <b>Class</b>-<b>Action</b> Lawsuit Over Wages</a><font size=\"-1\" color=\"#6f6f6f\"><nobr>CSNews Online</nobr></font></font><br /><font size=\"-1\"><a href=\"http://pr-bg.com/content/view/257352/80/\">Hacker Murphy Files <b>Class Action</b> Lawsuit against Stewart&#39;s Shops Claiming <b>...</b></a><font size=\"-1\" color=\"#6f6f6f\"><nobr>PR-BG.com (прессъобщения) (press release)</nobr></font></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=d1dPlDeYfHrLI8MPrkBfJjCXGj77M&amp;authuser=0&amp;ned=us\"><nobr... 2 news articles&nbsp;&raquo;</b></nobr></a></font></div></font></td></tr></table><table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://www.nj.com/essex/index.ssf/2014/01/class-action_lawsuit_by_livery_drivers_accuses_christie_ad... lawsuit by livery drivers accuses Christie Administration of <b>...</b></b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">The Star-Ledger - NJ.com</font></b></font><br /><font size=\"-1\">Six livery car companies who say they lost business while stuck in traffic at the George Washington Bridge in September filed a <b>class</b>-<b>action</b> lawsuit against the Christie Administration and the governor&#39;s campaign operation today, claiming their <b>...</b></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=dE0rAYOui7UbVTM&amp;authuser=0&amp;ned=us\"><nobr><b>and more&nbsp;&raquo;</b></nobr></a></font></div></font></td></tr></table><table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://www.fitsnews.com/2014/01/13/class-action-suit-filed-upstate-polluter/\"><b><b>Class Action</b> Suit Filed Against Upstate Polluter</b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">FITSNews</font></b></font><br /><font size=\"-1\">Remember the Hoechst-Celanese plant in Upstate, S.C.? Of course not ... it&#39;s been a long time since it&#39;s been on the public radar. The scandal surrounding this facility first broke open in December 2010, when WSPA TV 7 (Spartanburg, SC) did a three-part&nbsp;<b>...</b></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=dOUw2WK0QUiPwpM&amp;authuser=0&amp;ned=us\"><nobr><b></b></nobr... border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://www.prnewswire.com/news-releases/ryan--maniskas-llp-announces-class-action-lawsuit-against-ba... &amp; Maniskas, LLP Announces <b>Class Action</b> Lawsuit Against Barnes &amp; Noble <b>...</b></b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">PR Newswire (press release)</font></b></font><br /><font size=\"-1\">WAYNE, Pa., Jan. 13, 2014 /PRNewswire/ -- Ryan &amp; Maniskas, LLP announces that a <b>class action</b> lawsuit has been filed in the United States District Court for the United States District Court for the Southern District of New York on behalf of purchasers <b>...</b></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=dde8LEOO2UnHPuM&amp;authuser=0&amp;ned=us\"><nobr><b>and more&nbsp;&raquo;</b></nobr></a></font></div></font></td></tr></table><table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://www.4-traders.com/BARNES--NOBLE-INC-11858/news/Barnes--Noble-Inc--Ryan--Maniskas-LLP-Announce... &amp; Noble, Inc. : Ryan &amp; Maniskas, LLP Announces <b>Class Action</b> Lawsuit <b>...</b></b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">4-traders (press release)</font></b></font><br /><font size=\"-1\">WAYNE, Pa., Jan. 13, 2014 /PRNewswire/ -- Ryan &amp; Maniskas, LLP announces that a <b>class action</b> lawsuit has been filed in the United States District Court for the United States District Court for the Southern District of New York on behalf of purchasers <b>...</b></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=dE-oElEUPx_CVAM&amp;authuser=0&amp;ned=us\"><nobr><b>and more&nbsp;&raquo;</b></nobr></a></font></div></font></td></tr></table><table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://fashionista.com/2014/01/elite-models-to-fork-over-450000-to-unpaid-interns-in-class-action-se... Models to Fork Over $450000 to Unpaid Interns in <b>Class Action</b> Settlement</b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">Fashionista</font></b></font><br /><font size=\"-1\">On Friday, the District Court for the Southern District of New York approved a $450,000 <b>class action</b> settlement, guaranteeing participating interns a minimum payment of $700, and as much as $1,750. It&#39;s the largest settlement of an intern <b>class action</b> <b>...</b></font><br /><font size=\"-1\"><a href=\"http://www.law360.com/employment/articles/500826/elite-modeling-reaches-largest-ever-unpaid-intern-s... Modeling Reaches Largest-Ever Unpaid Intern Settlement</a><font size=\"-1\" color=\"#6f6f6f\"><nobr>Law360 (subscription)</nobr></font></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=dkPzwdGiNb8hnTMJ-3Nwk0unb86PM&amp;authuser=0&amp;ned=us\"><nobr... 2 news articles&nbsp;&raquo;</b></nobr></a></font></div></font></td></tr></table><table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://www.globalpost.com/dispatch/news/thomson-reuters/140113/will-consumer-class-actions-vs-target... consumer <b>class actions</b> vs. Target survive?</b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">GlobalPost</font></b></font><br /><font size=\"-1\">And depending on the facts that emerge about Target&#39;s disclosure decisions, Target shareholders may have viable <b>class action</b> claims that the company engaged in misrepresentation-by-omission. A FATAL INTERSECTION. Customers, however, are a&nbsp;<b>...</b></font><br /><font size=\"-1\"><a href=\"http://www.mondaq.com/unitedstates/x/285532/Class%2BActions/Privacy%2BClass%2BAction%2BArticle%2BIII... <b>Class Action</b> -- Article III Standing -- 2013 Outlook</a><font size=\"-1\" color=\"#6f6f6f\"><nobr>Mondaq News Alerts (registration)</nobr></font></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=dK9PLhQaLnkV4GMP2_IeYz_zqG1yM&amp;authuser=0&amp;ned=us\"><nobr... 3 news articles&nbsp;&raquo;</b></nobr></a></font></div></font></td></tr></table><table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://www.law360.com/commercialcontracts/articles/500809/delta-shakes-off-class-action-over-frequen... Shakes <b>Class Action</b> Over Frequent Flier Miles</b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">Law360 (subscription)</font></b></font><br /><font size=\"-1\">Law360, Los Angeles (January 13, 2014, 3:50 PM ET) -- A Georgia federal judge on Friday tossed a putative <b>class action</b> against Delta Air Lines Inc. that alleged Delta skimped on frequent flier miles by using the geographic distance between destinations <b>...</b></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=d6-7cCFMcPJpY4M&amp;authuser=0&amp;ned=us\"><nobr><b>and more&nbsp;&raquo;</b></nobr></a></font></div></font></td></tr></table><table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://www.nasdaq.com/press-release/shareholder-alert-pomerantz-law-firm-announces-the-filing-of-a-c... ALERT: Pomerantz Law Firm Announces the Filing of a <b>Class</b> <b>...</b></b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">NASDAQ</font></b></font><br /><font size=\"-1\">The <b>class action</b>, filed in United States District Court, Northern District of California, and docketed under 14-cv-00188, is on behalf of a class consisting of all persons or entities who purchased or otherwise acquired Electronic Arts securities <b>...</b></font><br /><font size=\"-1\"><a href=\"http://www.4-traders.com/INTL-FCSTONE-INC-7010788/news/INTL-Fcstone-Inc--Pomerantz-Law-Firm-Has-File... Fcstone Inc : Pomerantz Law Firm Has Filed a <b>Class Action</b> Against INTL <b>...</b></a><font size=\"-1\" color=\"#6f6f6f\"><nobr>4-traders (press release)</nobr></font></font><br /><font size=\"-1\"><a href=\"http://www.marketwatch.com/story/pomerantz-law-firm-has-filed-a-class-action-against-intl-fcstone-in... Law Firm Has Filed a <b>Class Action</b> Against INTL FCStone, Inc. and <b>...</b></a><font size=\"-1\" color=\"#6f6f6f\"><nobr>MarketWatch</nobr></font></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=dzacYqarf0wWsVMbh4MwxdbmkPvRM&amp;authuser=0&amp;ned=us\"><nobr... 7 news articles&nbsp;&raquo;</b></nobr></a></font></div></font></td></tr></table><table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://www.4-traders.com/INTL-FCSTONE-INC-7010788/news/INTL-Fcstone-Inc--Pomerantz-Law-Firm-Has-File... Fcstone Inc : Pomerantz Law Firm Has Filed a <b>Class Action</b> Against INTL <b>...</b></b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">4-traders (press release)</font></b></font><br /><font size=\"-1\">The <b>class action</b>, filed in United States District Court, Southern District of New York , and docketed under 14-cv-232, is on behalf of a class consisting of all persons or entities who purchased or otherwise acquired securities of INTL FCStone between <b>...</b></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=dbh4MwxdbmkPvRM&amp;authuser=0&amp;ned=us\"><nobr><b>and more&nbsp;&raquo;</b></nobr></a></font></div></font></td></tr></table><table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://lunch.publishersmarketplace.com/2014/01/class-action-firms-file-shareholder-suit-barnes-noble... Action</b> Firms File Shareholder Suit Against Barnes &amp; Noble</b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">Publishers Lunch Deluxe (subscription)</font></b></font><br /><font size=\"-1\">After Barnes &amp; Noble acknowledged two SEC investigations into its accounting practices on December 5, a wave of <b>class</b>-<b>action</b> law firms announced &quot;investigations&quot; of their own and asked shareholders to contact them. On Monday two of those firms&nbsp;<b>...</b></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=d1Ezabl7zZmM2MM&amp;authuser=0&amp;ned=us\"><nobr><b>and more&nbsp;&raquo;</b></nobr></a></font></div></font></td></tr></table><table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://www.watertowndailytimes.com/article/20140114/NEWS07/701149935\"><b>Lewis County woman files <b>class</b>-<b>action</b> suit against Stewart&#39;s Shops over pay <b>...</b></b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">WatertownDailyTimes.com</font></b></font><br /><font size=\"-1\">A Lewis County woman is the lead plaintiff in a proposed federal <b>class</b>-<b>action</b> lawsuit against Stewart&#39;s Shops Inc. over alleged violations of state and federal wage and hour laws. Holly Gregory, address not available, filed action on behalf of herself <b>...</b></font><br /><font size=\"-1\"><a href=\"http://www.wwnytv.com/news/local/Stewarts-Shops-Faces-Class-Action-Lawsuit-239985071.html\">Stewart&... Shops Faces <b>Class Action</b> Lawsuit</a><font size=\"-1\" color=\"#6f6f6f\"><nobr>WWNY TV 7</nobr></font></font><br /><font size=\"-1\"><a href=\"http://www.csnews.com/top-story-in_the_courts-c51-stewart_s_shops_faces_class_action_lawsuit_over_wa... Shops Faces <b>Class</b>-<b>Action</b> Lawsuit Over Wages</a><font size=\"-1\" color=\"#6f6f6f\"><nobr>CSNews Online</nobr></font></font><br /><font size=\"-1\"><a href=\"http://pr-bg.com/content/view/257352/80/\">Hacker Murphy Files <b>Class Action</b> Lawsuit against Stewart&#39;s Shops Claiming <b>...</b></a><font size=\"-1\" color=\"#6f6f6f\"><nobr>PR-BG.com (прессъобщения) (press release)</nobr></font></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=dSYB-EJwnUe762M1dPlDeYfHrLI8M&amp;authuser=0&amp;ned=us\"><nobr... 4 news articles&nbsp;&raquo;</b></nobr></a></font></div></font></td></tr></table><table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://www.nj.com/essex/index.ssf/2014/01/class-action_lawsuit_by_livery_drivers_accuses_christie_ad... drivers&#39; lawsuit accuses Christie administration of &#39;reckless conduct <b>...</b></b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">The Star-Ledger - NJ.com</font></b></font><br /><font size=\"-1\">Six livery car companies that say they lost business while stuck in traffic at the George Washington Bridge in September filed a <b>class</b>-<b>action</b> lawsuit in Superior Court in Hackensack today against the Christie administration and the governor&#39;s campaign&nbsp;<b>...</b></font><br /><font size=\"-1\"><a href=\"http://www.northjersey.com/news/Cabbies_caught_in_GWB_lane_closure_traffic_sue_Christies_staff_for_d... caught in GWB lane closure traffic sue Christie&#39;s staff for damages</a><font size=\"-1\" color=\"#6f6f6f\"><nobr>NorthJersey.com</nobr></font></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=dE0rAYOui7UbVTMRwk1Tuj4i2ERXM&amp;authuser=0&amp;ned=us\"><nobr... 4 news articles&nbsp;&raquo;</b></nobr></a></font></div></font></td></tr></table><table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://www.lexology.com/library/detail.aspx?g%3Dfa8940c2-2f38-4f52-b033-f5beb202ce04\"><b>Update: the state of <b>class actions</b> in Alberta - January 2014</b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">Lexology (registration)</font></b></font><br /><font size=\"-1\"><b>Class action</b> lawsuits are deeply rooted in American legal culture. The number and variety of American <b>class actions</b> significantly eclipses the number and variety of <b>class actions</b> in Canada. Successful <b>class actions</b> in the United States are increasingly <b>...</b></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=d8Jbt8MajnHhHPM&amp;authuser=0&amp;ned=us\"><nobr><b></b></nobr... border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://wvrecord.com/news/s-3961-kanawha-county/265363-at-least-eight-class-actions-filed-over-west-v... least eight <b>class actions</b> filed over West Virginia chemical spill</b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">West Virginia Record</font></b></font><br /><font size=\"-1\">CHARLESTON -- At least eight <b>class action</b> lawsuits have been filed in Kanawha Circuit Court against Freedom Industries for a chemical leak in West Virginia that caused more than 300,000 residents to go without water for days. West Virginia-American <b>...</b></font><br /><font size=\"-1\"><a href=\"http://www.wchstv.com/newsroom/eyewitness/140110_22286.shtml\">Chemical Spill, Water Contamination Draws Lawsuits</a><font size=\"-1\" color=\"#6f6f6f\"><nobr>WCHS-TV8</nobr></font></font><br /><font size=\"-1\"><a href=\"http://pr-bg.com/content/view/255699/78/\"><b>Class Action</b> Lawsuit Filed on Behalf of West Virginia Residents Affected by <b>...</b></a><font size=\"-1\" color=\"#6f6f6f\"><nobr>PR-BG.com (прессъобщения) (press release)</nobr></font></font><br /><font size=\"-1\"><a href=\"http://www.virtual-strategy.com/2014/01/11/west-virginia-business-owners-represented-class-action-la... Virginia Business Owners Represented in <b>Class Action</b> Lawsuit over Elk <b>...</b></a><font size=\"-1\" color=\"#6f6f6f\"><nobr>Virtual-Strategy Magazine (press release)</nobr></font></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=dbUjoRuRxgr3jQM5Kck83J4pv8UUM&amp;authuser=0&amp;ned=us\"><nobr... 4,117 news articles&nbsp;&raquo;</b></nobr></a></font></div></font></td></tr></table><table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://www.publishersweekly.com/pw/by-topic/industry-news/bookselling/article/60630-class-action-sui... Action</b> Suits Filed Against B&amp;N</b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">Publishers Weekly</font></b></font><br /><font size=\"-1\">A number of law firms have filed <b>class action</b> lawsuits against Barnes &amp; Noble that charge the company misled investors between February 25, 2013 and December 5, 2013. The suits are based on a disclosure made by B&amp;N in its filing with the SEC in&nbsp;<b>...</b></font><br /><font size=\"-1\"><a href=\"http://www.sacbee.com/2014/01/13/6068928/shareholder-alert-pomerantz-law.html\">SHAREHOLDER ALERT: Pomerantz Law Firm Announces the Filing of a <b>Class</b> <b>...</b></a><font size=\"-1\" color=\"#6f6f6f\"><nobr>Sacramento Bee</nobr></font></font><br /><font size=\"-1\"><a href=\"http://lunch.publishersmarketplace.com/2014/01/class-action-firms-file-shareholder-suit-barnes-noble... Action</b> Firms File Shareholder Suit Against Barnes &amp; Noble</a><font size=\"-1\" color=\"#6f6f6f\"><nobr>Publishers Lunch Deluxe (subscription)</nobr></font></font><br /><font size=\"-1\"><a href=\"http://goodereader.com/blog/e-book-news/bn-the-next-book-retailer-facing-class-action-lawsuit\">B&am... the Next Book Retailer Facing <b>Class Action</b> Lawsuit</a><font size=\"-1\" color=\"#6f6f6f\"><nobr>Good E-Reader (blog)</nobr></font></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=dfEwTcRORmrPmnMwab8XUMQI3BdGM&amp;authuser=0&amp;ned=us\"><nobr... 16 news articles&nbsp;&raquo;</b></nobr></a></font></div></font></td></tr></table><table border=\"0\" cellpadding=\"2\" cellspacing=\"7\" style=\"vertical-align:top;\"><tr><td valign=\"top\" class=\"j\"><font style=\"font-size:85%;font-family:arial,sans-serif\"><br /><div style=\"padding-top:0.8em;\"></div><div class=\"lh\"><a href=\"http://blogs.wsj.com/law/2014/01/14/state-ag-suits-not-governed-by-class-action-curbs-supreme-court-... AG Suits Not Governed By <b>Class</b>-<b>Action</b> Curbs, Supreme Court Says</b></a><br /><font size=\"-1\"><b><font color=\"#6f6f6f\">Wall Street Journal (blog)</font></b></font><br /><font size=\"-1\">The court, in a unanimous 14-page ruling, had little trouble in concluding that state AG lawsuits seeking damages for alleged corporate wrongdoing are not constrained by the federal <b>Class Action</b> Fairness Act. At issue was a type lawsuit known as a <b>...</b></font><br /><font size=\"-1\" class=\"p\"></font><br /><font class=\"p\" size=\"-1\"><a class=\"p\" href=\"http://news.google.com/news/more?ncl=dGP8h15eSFMC6-M&amp;authuser=0&amp;ned=us\"><nobr><b></b></nobr...                                </td>                            </tr>                            <tr>                                <td style=\"width: 73px;\" width=\"73px\">                                                                     </td>                                <td style=\"width: 7px;\" width=\"7px\">                                                                     </td>                                <td style=\"background-color: #FFFFFF; font-family: Arial; font-size: 7.5pt; color: #3c3c3c;                                    text-align: center; width: 579px;\" width=\"579px\">                                    <table style=\"background-color: #FFFFFF; font-family: Arial; font-size: 7.5pt; color: #3c3c3c;                                        text-align: center; width: 100%;\" width=\"100%\">                                        <tbody>                                            <tr>                                                <td style=\"width: 579px; font-family: Arial; font-size: 7.5pt; color: #3c3c3c; padding-top: 5px;                                                    margin-top: 5px;\" width=\"579px\">                                                    <img src=\"http://www.abdataclassaction.com/Images/contact_building.gif\" alt=\"address\"                                                        width=\"11px\" height=\"10px\" />&nbsp;600 A.B. Data Drive, Milwaukee, WI 53217&nbsp;&nbsp;&nbsp;                                                        <img src=\"http://www.abdataclassaction.com/Images/contact_phone.gif\" alt=\"phone\" width=\"11px\"                                                            height=\"10px\" />&nbsp;646-290-9137&nbsp;&nbsp;&nbsp;<img src=\"http://www.abdataclassaction.com/Images/contact_fax.gif\" alt=\"fax\" width=\"11px\"                                                        height=\"10px\" />&nbsp;414-961-7499&nbsp;&nbsp;&nbsp;                                                        <img src=\"http://www.abdataclassaction.com/Images/contact_email.gif\" alt=\"email\"                                                        width=\"11px\" height=\"10px\" />&nbsp;<a style=\"color: #3c3c3c;\" href=\"mailto:info@abdataclassaction.com\">info@abdataclassaction.com</a>                                                </td>                                            </tr>                                            <tr>                                                <td style=\"width: 579px; font-family: Arial; font-size: 7.5pt; color: #3c3c3c;\" width=\"579px\">                                                    <strong>Washington, D.C., &nbsp;New York, NY, &nbsp;San                                                        Francisco, CA, &nbsp;Milwaukee, WI, &nbsp;West Palm Beach,                                                        FL</strong>                                                </td>                                            </tr>                                            <tr>                                                <td style=\"width: 579px; font-family: Arial; font-size: 7.5pt; color: #3c3c3c; text-align: justify;\"                                                    width=\"579px\">                                                    Founded in 1980, A.B. Data has earned an international reputation for expertly managing                                                    the complexities of class action administration in securities, ERISA, consumer,                                                    antitrust, employment, civil rights, insurance, environmental, and other class action                                                    cases. Dedicated professionals deliver A.B. Data’s all-inclusive services, working                                                    in partnership with its clients to administer their class action cases effectively,                                                    efficiently, and affordably, regardless of size or scope.                                                </td>                                            </tr>                                            <tr>                                                <td style=\"width: 579px; font-family: Arial; font-size: 7.5pt; color: #3c3c3c;\" width=\"579px\">                                                    <table style=\"width: 73px; text-align: center;\" align=\"center\" width=\"73px\">                                                        <tbody>                                                            <tr>                                                                <td style=\"text-align: right; margin: 3px auto; padding: 3px auto;\" align=\"right\">                                                                    <a href=\"http://www.facebook.com/pages/AB-Data-Ltd/129039655997\">                                                                        <img src=\"http://www.abdataclassaction.com/Newsletters/Images/facebook_24.jpg\" alt=\"A.B. Data, Ltd. :: Facebook\"                                                                            border=\"0\" height=\"24px\" width=\"24px\" /></a>                                                                </td>                                                                <td style=\"text-align: right; margin: 3px auto; padding: 3px auto;\" align=\"right\">                                                                    <a href=\"http://twitter.com/ClassActionABD\">                                                                        <img src=\"http://www.abdataclassaction.com/Newsletters/Images/twitter_24.png\" alt=\"A.B. Data, Ltd. :: Twitter\"                                                                            border=\"0\" height=\"25px\" width=\"25px\" /></a>                                                                </td>                                                                <td style=\"text-align: right; margin: 3px auto; padding: 3px auto;\" align=\"right\">                                                                    <a href=\"http://www.linkedin.com/company/ab-data-ltd\">                                                                        <img src=\"http://www.abdataclassaction.com/Newsletters/Images/linkedin_24.gif\" alt=\"A.B. Data, Ltd. :: Linked In\"                                                                            border=\"0\" height=\"24px\" width=\"24px\" /></a>                                                                </td>                                                                <td style=\"text-align: right; margin: 3px auto; padding: 3px auto;\" align=\"right\">                                                                    <a href=\"http://rss.abdataclassaction.com/NewsFeed.xml\">                                                                        <img src=\"http://www.abdataclassaction.com/Newsletters/Images/rss_24.gif\" alt=\"A.B. Data, Ltd. :: Rss\"                                                                            border=\"0\" height=\"24px\" width=\"24px\" /></a>                                                                </td>                                                            </tr>                                                        </tbody>                                                    </table>                                                </td>                                            </tr>                                            <tr>                                                <td style=\"width: 579px; font-family: Arial; font-size: 7.5pt; color: #3c3c3c;\" width=\"579px\">                                                    &copy; 2014 A.B. Data, Ltd. All Rights Reserved.                                                </td>                                            </tr>                                            <tr>                                                <td style=\"width: 579px; font-family: Arial; font-size: 7.5pt; color: #3c3c3c;\" width=\"579px\">                                                    You are receiving this complimentary news service because         you subscribed to A.B.                                                    Data's Class Action News.                                                </td>                                            </tr>                                            <tr>                                                <td style=\"width: 579px; font-family: Arial; font-size: 7.5pt; color: #3c3c3c;\" width=\"579px\">                                                    <a style=\"font-family: Arial; font-size: 7.5pt; color: #3c3c3c;\" href=\"http://abdataclassaction.com/Retain.aspx\">                                                        Retain A.B. Data</a>&nbsp;&nbsp;&nbsp;<a style=\"color: #3c3c3c;\" href=\"http://abdataclassaction.com\">abdataclassaction.com</a>                                                        &nbsp;&nbsp;&nbsp;<a style=\"color: #3c3c3c;\" href=\"http://www.abdataclassaction.com/SubscribeToABDataNews.aspx\">Unsubscribe                                                            from Class Action News</a>                                                </td>                                            </tr>                                        </tbody>                                    </table>                                </td>                            </tr>                        </tbody>                    </table>                </td>            </tr>        </tbody>    </table></body></html>"}

 

Thank you,

Paul

Highlighted
Occasional Contributor

Re: 400: Bad Request received when posting campaign

I was able to fix the problems by checking the string for characters that are not ISO 8859-1 compliant, and replacing them with compliant characters. The offenders were mostly old style quotes (”) and some dashes. The following code works great.

 

        private static void ConvertToISO(ref string input)
        {
            byte[] bytes = null;
            string result = string.Empty;

            for (int i = 0; i < input.Length; i++)
            {
                bytes = Encoding.GetEncoding("ISO-8859-1").GetBytes(input[i].ToString());
                result = Encoding.GetEncoding("ISO-8859-1").GetString(bytes);

                if (!string.Equals(input[i].ToString(), result))
                {
                    input = input.Replace(input[i], char.Parse(result));
                }
            }
        }

 

In the end, my campaign was successfully created. Thanks!

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