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
Hi Archana,
For the email tags after the <EmailContent> tag, all of the email tags needs to be encoded with < replacing <.
It should read:
<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>
I hope that helps!
Best Regards,
Shannon Wallace
Support Engineer