Creating Campaign Return Error 400

brayancastrop
Occasional Participant

Creating Campaign Return Error 400

Hi, im having problems creating Campaigns... im having an error 400 Bad request as response


here is my xml


 


<entry xmlns=\"http://www.w3.org/2005/Atom\">\n       

<title type=\"text\"> </title>\n       

<updated>2011-03-09T15:10:52Z</updated>\n       

<author></author>\n       

<id>data:,none</id>\n       

<summary type=\"text\">Campaign</summary>\n      

<content type=\"application/vnd.ctct+xml\">\n       

<Campaign xmlns=\"http://ws.constantcontact.com/ns/1.0/\">

<EmailContent>&lt;p&gt;Aliquam lectus orci, adipiscing et, sodales ac, feugiat non, lacus. Ut dictum velit nec est. Quisque posuere, purus sit amet malesuada blandit, sapien sapien auctor arcu, sed pulvinar felis mi sollicitudin tortor. Maecenas volutpat, nisl et dignissim pharetra, urna lectus ultrices est, vel pretium pede turpis id velit. Aliquam sagittis magna in felis egestas rutrum. Proin wisi libero, vestibulum eget, pulvinar nec, suscipit ut, mi. Integer in arcu ultricies leo dapibus ultricies. Sed rhoncus lobortis dolor. Suspendisse dolor. Mauris sapien velit, pulvinar non, rutrum non, consectetuer eget, metus. Morbi tincidunt lorem at urna. Etiam porta. Ut mauris. Phasellus tristique rhoncus magna. Nam tincidunt consequat urna. Sed tempor.&lt;/p&gt;</EmailContent>

<OrganizationPostalCode>057</OrganizationPostalCode>

<IncludeForwardEmail>YES</IncludeForwardEmail>

<Status>DRAFT</Status>

<OrganizationState>AT</OrganizationState>

<Subject>Campaign for event attached</Subject>

<GreetingString>Greetings!</GreetingString>

<EmailContentFormat>HTML</EmailContentFormat>

<Name>Tester campaign for event</Name>

<OrganizationInternationalState></OrganizationInternationalState>

<FromName>Brayan Castro</FromName>

<PermissionReminder>YES</PermissionReminder>

<ViewAsWebpage>YES</ViewAsWebpage>

<PermissionReminderText>You're receiving this email because of your relationship with us. Please &lt;ConfirmOptin&gt;&lt;a style=&quot;color:#0000ff;&quot;&gt;confirm&lt;/a&gt;&lt;/ConfirmOptin&gt; your continued interest in receiving email from us.</PermissionReminderText>

<StyleSheet></StyleSheet>

<GreetingName>FirstName</GreetingName>

<OrganizationAddress1>Cra 11</OrganizationAddress1>

<ViewAsWebpageText>Looks bad</ViewAsWebpageText>

<OrganizationCountry>Colombia</OrganizationCountry>

<ViewAsWebpageLinkText>View as a Web page</ViewAsWebpageLinkText>

<GreetingSalutation>Dear</GreetingSalutation>

<SubscribeLinkText></SubscribeLinkText>

<IncludeSubscribeLink>NO</IncludeSubscribeLink>

<OrganizationAddress2></OrganizationAddress2>

<EmailTextContent>&lt;Text&gt;Aliquam lectus orci, adipiscing et, sodales ac, feugiat non, lacus. Ut dictum velit nec est. Quisque posuere, purus sit amet malesuada blandit, sapien sapien auctor arcu, sed pulvinar felis mi sollicitudin tortor. Maecenas volutpat, nisl et dignissim pharetra, urna lectus ultrices est, vel pretium pede turpis id velit. Aliquam sagittis magna in felis egestas rutrum. Proin wisi libero, vestibulum eget, pulvinar nec, suscipit ut, mi. Integer in arcu ultricies leo dapibus ultricies. Sed rhoncus lobortis dolor. Suspendisse dolor. Mauris sapien velit, pulvinar non, rutrum non, consectetuer eget, metus. Morbi tincidunt lorem at urna. Etiam porta. Ut mauris. Phasellus tristique rhoncus magna. Nam tincidunt consequat urna. Sed tempor.&lt;/Text&gt;</EmailTextContent>

<OrganizationAddress3></OrganizationAddress3>

<ForwardEmailLinkText>Froward email</ForwardEmailLinkText>

<OrganizationCity>Barranquilla</OrganizationCity>

<OrganizationName>brayancastrop</OrganizationName>

<ReplyToEmail><Email id=\"http://api.constantcontact.com/ws/customers/brayancastrop/settings/emailaddresses/1\"/></ReplyToEmail>

<FromEmail><Email id=\"http://api.constantcontact.com/ws/customers/brayancastrop/settings/emailaddresses/1\"/></FromEmail>

<ContactLists><ContactList id=\"http://api.constantcontact.com/ws/customers/brayancastrop/lists/1\"/></ContactLists>

</Campaign>\n       

</content>\n     

</entry>

Brayan Castro

2 REPLIES 2
bsoder
Employee

Hello,



I looked over your XML, and I believe the reason that you are receiving errors is that you need to post the campaigns with valid HTML or XHTML. In your example, you are missing the HTML and BODY tags that would be around the P tag. When I used your XML and added those, I was able to successfully post the XML.



If you are running into any problems, please let me know.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
brayancastrop
Occasional Participant

Great, that was the problem, i only add the tags missing and it work's perfect


Thanks for the help!!!

Brayan Castro

Developer Portal

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

Visit Page