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.

Re: The requested URL returned error: 400

Highlighted
Occasional Contributor

Re: The requested URL returned error: 400

Hello,

 

Can anyone help me with create campaign xml code. Below is the xml I am sending with POST method but I am getting error 'The requested URL returned error: 400'

 

XML Code:

<entry><link href="/ws/customers/archana@rapidsoftsystems.com/campaigns" rel="edit"/><id>http://api.constantcontact.com/ws/customers/archana@rapidsoftsystems.com/campaigns</id><title type="text">test campaign</title><updated>2012-02-25T10:42:55+01:00</updated><author><name>Constant Contact</name></author><content type="application/vnd.ctct+xml"><Campaign id="http://api.constantcontact.com/ws/customers/archana@rapidsoftsystems.com/campaigns/1100546096289"><Name>test campaign</Name><Status>Draft</Status><Date>2012-02-25T10:42:55 01:00</Date><Subject>test campaign subject</Subject><FromName>Archana Singh</FromName><ViewAsWebpage>NO</ViewAsWebpage><ViewAsWebpageLinkText/><ViewAsWebpageText/><PermissionReminder>NO</PermissionReminder><PermissionReminderText/><GreetingSalutation>salutation</GreetingSalutation><GreetingName>greeting text</GreetingName><GreetingString>greeting string</GreetingString><OrganizationName>Rapidsoft Systems</OrganizationName><OrganizationAddress1>Sector 8</OrganizationAddress1><OrganizationAddress2/><OrganizationAddress3/><OrganizationCity>Noida</OrganizationCity><OrganizationState/><OrganizationInternationalState>Uttar Pradesh</OrganizationInternationalState><OrganizationCountry>IN</OrganizationCountry><OrganizationPostalCode>201301</OrganizationPostalCode><IncludeForwardEmail>NO</IncludeForwardEmail><ForwardEmailLinkText/><IncludeSubscribeLink>NO</IncludeSubscribeLink><SubscribeLinkText/><EmailContentFormat>HTML</EmailContentFormat><EmailContent><html lang=\"en\" xml:lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"

xmlns:cctd=\"http://www.constantcontact.com/cctd\">

<body><CopyRight>Copyright (c) 1996-2009 Constant Contact. All rights reserved.  Except as permitted under a

separate

written agreement with Constant Contact, neither the Constant Contact software, nor any content that appears on any

Constant Contact site,

including but not limited to, web pages, newsletters, or templates may be reproduced, republished, repurposed, or

distributed without the

prior written permission of Constant Contact.  For inquiries regarding reproduction or distribution of any Constant

Contact material, please

contact joesflowers@example.com.</CopyRight>

<OpenTracking/>

<!--  Do NOT delete previous line if you want to get statistics on the number of opened emails -->

<CustomBlock name=\"letter.intro\" title=\"Personalization\">

    <Greeting/>

</CustomBlock>

</body>

</html></EmailContent><EmailTextContent><Text>This is the text version.</Text></EmailTextContent><StyleSheet/><ContactLists><ContactList id="http://api.constantcontact.com/ws/customers/archana%40rapidsoftsystems.com/lists/2"><link href="/ws/customers/archana%40rapidsoftsystems.com/lists/2" rel="self"/></ContactList></ContactLists><FromEmail><Email id="http://api.constantcontact.com/ws/customers/archana@rapidsoftsystems.com/settings/emailaddresses/1"><link href="/ws/customers/archana@rapidsoftsystems.com/settings/emailaddresses/1" rel="self"/></Email><EmailAddress>archana@rapidsoftsystems.com</EmailAddress></FromEmail><ReplyToEmail><Email id="http://api.constantcontact.com/ws/customers/archana@rapidsoftsystems.com/settings/emailaddresses/1"><link href="/ws/customers/archana@rapidsoftsystems.com/settings/emailaddresses/1" rel="self"/></Email><EmailAddress>archana@rapidsoftsystems.com</EmailAddress></ReplyToEmail></Campaign></content><source><id>http://api.constantcontact.com/ws/customers/archana@rapidsoftsystems.com/campaigns</id><title type="text">Campaigns for customer: archana@rapidsoftsystems.com</title><link href="campaigns"/><link href="campaigns" rel="self"/><author><name>archana@rapidsoftsystems.com</name></author><updated>2012-02-25T10:42:55+01:00</updated></source></entry>

 

 

 

Thanks & Regards,

Archana Singh

1 REPLY 1
Highlighted
Employee

Re: The requested URL returned error: 400

Hi Archana,

 

For the email tags after the <EmailContent> tag, all of the email tags needs to be encoded with &lt; replacing <.

 

It should read:

 

<EmailContent>
&lt;html lang=\"en\" xml:lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:cctd=\"http://www.constantcontact.com/cctd\"> &lt;body>&lt;CopyRight>Copyright (c) 1996-2009 Constant Contact. All rights reserved. Except as permitted under a separate written agreement with Constant Contact, neither the Constant Contact software, nor any content that appears on any Constant Contact site, including but not limited to, web pages, newsletters, or templates may be reproduced, republished, repurposed, or distributed without the prior written permission of Constant Contact. For inquiries regarding reproduction or distribution of any Constant Contact material, please contact joesflowers@example.com.&lt;/CopyRight> &lt;OpenTracking/> &lt;!-- Do NOT delete previous line if you want to get statistics on the number of opened emails --> &lt;CustomBlock name=\"letter.intro\" title=\"Personalization\"> &lt;Greeting/> &lt;/CustomBlock> &lt;/body> &lt;/html>

 

I hope that helps!

 

Best Regards,

Shannon Wallace

Support Engineer

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