We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

400 error while creating campaign

QyukiD
Participant

400 error while creating campaign

hi, I get a 400 error when iam trying to run create campaign api. the Xml structure is as follows:

 

 <?xml version="1.0" encoding="UTF-8"?><entry xmlns="http://www.w3.org/2005/Atom"><link href="/ws/customers/qyukimail/campaigns" rel="edit"/><id>http://api.constantcontact.com/ws/customers/qyukimail/campaigns</id><title type="text">Reg 2 on qyuki</title><updated>2012-11-26T05:31:09+01:00</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/qyukimail/campaigns/1100546096289"><Name>Reg 2 on qyuki</Name><Status>Draft</Status><Date>2012-11-26T05:31:09 01:00</Date><Subject>Tester Email 2</Subject><FromName>Qyuki</FromName><ViewAsWebpage>NO</ViewAsWebpage><ViewAsWebpageLinkText></ViewAsWebpageLinkText><ViewAsWebpageText></ViewAsWebpageText><PermissionReminder></PermissionReminder><PermissionReminderText></PermissionReminderText><GreetingSalutation>Dear</GreetingSalutation><GreetingName>FirstName</GreetingName><GreetingString>Greetings!</GreetingString><OrganizationName>ctct</OrganizationName><OrganizationAddress1>123 wsw st</OrganizationAddress1><OrganizationAddress2>NO</OrganizationAddress2><OrganizationAddress3>NO</OrganizationAddress3><OrganizationCity>Ashland</OrganizationCity><OrganizationState>MA</OrganizationState><OrganizationInternationalState></OrganizationInternationalState><OrganizationCountry>us</OrganizationCountry><OrganizationPostalCode>32423</OrganizationPostalCode><IncludeForwardEmail>NO</IncludeForwardEmail><ForwardEmailLinkText>reshma.u@qyuki.com|abhishek.roy@qyuki.com</ForwardEmailLinkText><IncludeSubscribeLink>NO</IncludeSubscribeLink><SubscribeLinkText></SubscribeLinkText><EmailContentFormat>HTML</EmailContentFormat><EmailContent></EmailContent><EmailTextContent>&lt;Text&gt;&amp;lt;Text&gt;Something from Qyuki.&amp;lt;/Text&gt;&lt;/Text&gt;</EmailTextContent><StyleSheet></StyleSheet><ContactLists><ContactList id="1"><link xmlns="http://www.w3.org/2005/Atom" href="1" rel="self"/></ContactList></ContactLists><FromEmail><Email id="abhishek.roy@qyuki.com"><link xmlns="http://www.w3.org/2005/Atom" href="abhishek.roy@qyuki.com" rel="self"/></Email><EmailAddress>reshma.u@qyuki.com</EmailAddress></FromEmail><ReplyToEmail><Email id="abhishek.roy@qyuki.com"><link xmlns="http://www.w3.org/2005/Atom" href="abhishek.roy@qyuki.com" rel="self"/></Email><EmailAddress>reshma.u@qyuki.com</EmailAddress></ReplyToEmail></Campaign></content><source><id>http://api.constantcontact.com/ws/customers/qyukimail/campaigns</id><title type="text">Campaigns for customer: qyukimail</title><link href="campaigns"/><link href="campaigns" rel="self"/><author><name>qyukimail</name></author><updated>2012-11-26T05:31:09+01:00</updated></source></entry>

1 REPLY 1
Shannon_W
Employee

Hi,

 

I wasn't able to narrow down the issues with the XML to a point where it can be used for a successful request--there might be a small typo somewhere that I am missing.  Some of the issues I found were not providing html contents inside the EmailContents node, including a link other than in the accepted format for id or link portions of the XML ("http://api.constantcontact.com/ws/customers/username/settings/emailaddresses/1"), and omitting YES or NO in the PermissionReminder node.

 

It would be easiest to copy and paste the XML from this page, change the username and email address (joesflowers and joe@somedomain.com) to your own, and then make changes incrementally once that XML works.  I apologize that I wasn't able to find all of the errors and correct them for you.

 

Best Regards,

Shannon W.

API Support Specialist

Developer Portal

View API documentation, code samples, get your API key.

Visit Page