Hi,
I have downloded the code sample (NET_Sample_Campaign_Forms.zip) to create new Email Campaign from your forum.
In Web.Config I did the changes to add my user credentials and APIKey. When I ran the application and tried to Add Email Campaign, it returns the error as The remote server returned an error: (400) Bad Request.
Here is the xml content for Email campaign:
<?xml version='1.0' encoding='UTF-8'?><entry xmlns="http://www.w3.org/2005/Atom"><link href="/ws/customers/extentia.kmt/campaigns" rel="edit" /><id>http://api.constantcontact.com/ws/customers/extentia.kmt/campaigns</id><title type="text">Jul 13 2011</title><updated>2011-07-13T16:09:46.3316045+05:30</updated><author><name>Constant Contact</name></author><content type="application/vnd.ctct+xml"><Campaign xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/extentia.kmt/campaigns/0000000000000" ><Name>Jul 13 2011</Name><Status>Draft</Status><Date>2011-07-13T16:07:39.2855426+05:30</Date><Subject>News from</Subject><FromName>Suvarna</FromName><ViewAsWebpage>YES</ViewAsWebpage><ViewAsWebpageLinkText>Click here</ViewAsWebpageLinkText><ViewAsWebpageText>Having trouble viewing this email?</ViewAsWebpageText><PermissionReminder>YES</PermissionReminder><PermissionReminderText>You're receiving this email because of your relationship with extentia.kmt. Please confirm your continued interest in receiving email from us.</PermissionReminderText><GreetingSalutation></GreetingSalutation><GreetingName>FirstName</GreetingName><GreetingString></GreetingString><OrganizationName>Extentia</OrganizationName><OrganizationAddress1>Koregaon Park</OrganizationAddress1><OrganizationAddress2></OrganizationAddress2><OrganizationAddress3></OrganizationAddress3><OrganizationCity>Pune</OrganizationCity><OrganizationState></OrganizationState><OrganizationInternationalState></OrganizationInternationalState><OrganizationCountry>in</OrganizationCountry><OrganizationPostalCode>416001</OrganizationPostalCode><IncludeForwardEmail>YES</IncludeForwardEmail><ForwardEmailLinkText></ForwardEmailLinkText><IncludeSubscribeLink>YES</IncludeSubscribeLink><SubscribeLinkText></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 legal@constantcontact.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>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 legal@constantcontact.com.</Text></EmailTextContent><StyleSheet></StyleSheet><ContactLists><ContactList id="http://api.constantcontact.com/ws/customers/extentia.kmt/lists/1"><link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/extentia.kmt/lists/1" rel="self" /></ContactList></ContactLists><FromEmail><Email id="http://api.constantcontact.com/ws/customers/extentia.kmt/settings/emailaddresses/1"><link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/extentia.kmt/settings/emailaddresses/1" rel="self" /></Email><EmailAddress>suvarna.gavali@gmail.com</EmailAddress></FromEmail><ReplyToEmail><Email id="http://api.constantcontact.com/ws/customers/extentia.kmt/settings/emailaddresses/1"><link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/extentia.kmt/settings/emailaddresses/1" rel="self" /></Email><EmailAddress>suvarna.gavali@gmail.com</EmailAddress></ReplyToEmail></Campaign></content><source><id>http://api.constantcontact.com/ws/customers/extentia.kmt/campaigns</id><title type="text">Campaigns for customer: extentia.kmt</title><link href="campaigns" /><link href="campaigns" rel="self" /><author><name>extentia.kmt</name></author><updated>2011-07-13T16:10:19.8313901+05:30</updated></source></entry>
Can you please have a look into it and let us know how it can be solved?
Thanks,
Suvarna
Hi Suvarna,
I went through your XML and noticed that you are enabling the Subscribe and forward links but you are not specifying what you want to have for the link text. This code has been tested to work.
You can check out the documentation here and at the bottom of the page you will notice that if you have the option for the IncludeSubscribeLink set to YES then you must have a field for what text to display. In the XML it is referenced as
If you have any other questions please let me know.
Regards,
Hi Ryan,
Thanks.. It solved the issue.
Suvarna