Something wrong with this XML, I'm not seeing it

stevenshawnyc
Occasional Participant

Something wrong with this XML, I'm not seeing it

I'm getting a code 400 when I try to POST this XML: can anyone see what's wrong with it?


<code>


 


<?xml version="1.0" encoding="UTF-8"?>


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


<link href="/ws/customers/egulletpr/campaigns" rel="edit" />


<id>http://api.constantcontact.com/ws/customers/egulletpr/campaigns</id>


<title type="text">Bob</title>


<updated>2010-09-10T00:30:06+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/egulletpr/campaigns/1100546096289">


<Name>Bob</Name>


<Status>Draft</Status>


<Date>2010-09-10T00:30:05.000Z</Date>


<Subject>Subject</Subject>


<FromName>the eGullet Society Team</FromName>


<ViewAsWebpage>YES</ViewAsWebpage>


<ViewAsWebpageLinkText>Click here</ViewAsWebpageLinkText>


<ViewAsWebpageText>Having trouble viewing this email</ViewAsWebpageText>


<PermissionReminder>NO</PermissionReminder>


<PermissionReminderText></PermissionReminderText>


<GreetingSalutation>Dear</GreetingSalutation>


<GreetingName>FirstName</GreetingName>


<GreetingString></GreetingString>


<OrganizationName>eGullet Society for Culinary Arts and Letters</OrganizationName>


<OrganizationAddress1>20 East 93rd Street</OrganizationAddress1>


<OrganizationAddress2></OrganizationAddress2>


<OrganizationAddress3></OrganizationAddress3>


<OrganizationCity>New York</OrganizationCity>


<OrganizationState>NY</OrganizationState>


<OrganizationInternationalState></OrganizationInternationalState>


<OrganizationCountry>us</OrganizationCountry>


<OrganizationPostalCode>10128</OrganizationPostalCode>


<IncludeForwardEmail>YES</IncludeForwardEmail>


<ForwardEmailLinkText>Forward email</ForwardEmailLinkText>


<IncludeSubscribeLink>YES</IncludeSubscribeLink>


<SubscribeLinkText>Subscribe to eGullet Hot Topics announcements</SubscribeLinkText>


<EmailContentFormat>HTML</EmailContentFormat>


<EmailContent>html text</EmailContent>


<EmailTextContent><Text>TestText</Text></EmailTextContent>


<StyleSheet></StyleSheet>


<ContactLists>


<ContactList id="http://api.constantcontact.com/ws/customers/egulletpr/lists/18"><link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/egulletpr/lists/18" rel="self" /></ContactList>


</ContactLists>


<FromEmail>


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


<link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/egulletpr/settings/emailaddresses/1" rel="self" />


</Email>


<EmailAddress>confirm@egullet.org</EmailAddress>


</FromEmail>


<ReplyToEmail>


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


<link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/egulletpr/settings/emailaddresses/1" rel="self" />


</Email>


<EmailAddress>confirm@egullet.org</EmailAddress>


</ReplyToEmail>


</Campaign>


</content>


<source>


<id>http://api.constantcontact.com/ws/customers/egulletpr/campaigns</id>


<title type="text">Campaigns for customer: egulletpr</title>


<link href="campaigns" />


<link href="campaigns" rel="self" />


<author><name>egulletpr</name></author>


<updated>2010-09-10T00:30:06+01:00</updated>


</source>


</entry>


</code>

 

1 REPLY 1
bsoder
Employee

Hello,



I have looked over your XML and it appears that there are two issues that once I corrected, it posted fine. The first is the content node has to be valid HTML when being posted, with the minimum of opening and closing html and body tags.



The second issue is that in the EmailTextContent node you have text tags surrounding the text. This would need to be HTML encoded, using &lt; and &gt; tags. Also note that when creating correct HTML in the content node, this HTML also has to be HTML encoded.



If you have any questions regarding this please let me know.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Developer Portal

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

Visit Page