The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

400 Error - Posting XML for review

Highlighted
Occasional Participant

400 Error - Posting XML for review

I am unsure what is causing my 400 error. Here is the XML being generated and sent via CURL.


Thanks!




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


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


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


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


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


<updated>2010-09-23T13:44:40+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/myacct/campaigns/1100546096289">


<Name>test</Name>


<Status>Draft</Status>


<Date>2010-09-23T13:44:40 01:00</Date>


<Subject>test</Subject>


<FromName>Company</FromName>


<ViewAsWebpage>YES</ViewAsWebpage>


<ViewAsWebpageLinkText>Click Here</ViewAsWebpageLinkText>


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


<PermissionReminder>NO</PermissionReminder>


<PermissionReminderText></PermissionReminderText>


<GreetingSalutation>Dear</GreetingSalutation>


<GreetingName>Valued Customer</GreetingName>


<GreetingString></GreetingString>


<OrganizationName>Company</OrganizationName>


<OrganizationAddress1>addy</OrganizationAddress1>


<OrganizationAddress2></OrganizationAddress2>


<OrganizationAddress3></OrganizationAddress3>


<OrganizationCity>West Valley City</OrganizationCity>


<OrganizationState>UT</OrganizationState>


<OrganizationInternationalState></OrganizationInternationalState>


<OrganizationCountry>us</OrganizationCountry>


<OrganizationPostalCode>84118</OrganizationPostalCode>


<IncludeForwardEmail>NO</IncludeForwardEmail>


<ForwardEmailLinkText></ForwardEmailLinkText>


<IncludeSubscribeLink>NO</IncludeSubscribeLink>


<SubscribeLinkText></SubscribeLinkText>


<EmailContentFormat/>


<EmailContent>testbody</EmailContent>


<EmailTextContent>&lt;Text>txtver&lt;/Text></EmailTextContent>


<StyleSheet></StyleSheet>


<ContactLists>


<ContactList id="http://api.constantcontact.com/ws/customers/myacct/lists/13">


<link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/myacct/lists/13" rel="self" />


</ContactList>


</ContactLists>


<FromEmail>


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


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


</Email>


<EmailAddress>addy@addy.com</EmailAddress>


</FromEmail>


<ReplyToEmail>


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


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


</Email>


<EmailAddress>addy@addy.com</EmailAddress>


</ReplyToEmail>


</Campaign>


</content>


<source>


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


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


<link href="campaigns" />


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


<author>


<name>myacct</name>


</author>


<updated>2010-09-23T13:44:40+01:00</updated>


</source>


</entry>


 
2 REPLIES 2
Highlighted
Employee

posting a campaign

Hello,



There are a few things that I noticed need to be changed in the XML, and when I did that it worked on my end. I will list them here:



  1. The GreetingName tag must be either FirstName, LastName, FirstAndLastName, or NONE. The text that you have there should be in the Greeting GreetingString section.

  2. The second thing that I saw is that you did not have any value for EmailContentFormat. It has to either be HTML or XHTML

  3. Also I noticed that your EmailContent did not contain valid HTML or XHTML. It must contain either valid HTML or XHTML when posted, depending on what you pick for EmailContentFormat.

  4. If you make these changes, it should work for you. Please let me know if you have any further questions.



    Regards
Benjamin Soder
NOC Analyst
Constant Contact
Highlighted
Occasional Participant

 Awesome! Thanks for the

 Awesome! Thanks for the help!!!

Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured