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.

Error 400 : updating a campaign

Highlighted
Regular Visitor

Error 400 : updating a campaign

I am trying to update a campaign but getting the following error : 

 

Error 400: The request contains errors in the common Atom sections, which lie outside <entry> or <Content>, such as <feed>, <id>, <author> or <updated>.

 

The XML is shown below is based on the test api example, can anyone see what I have done wrong : 

 

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

<link href="/ws/customers/YouDeal/campaigns/1107642471864" rel="edit"></link> <id>http://api.constantcontact.com/ws/customers/YouDeal/campaigns/1107642471864</id>

<title type="text">Capetown Daily</title>

<updated>2011-09-15T11:09:07.279Z</updated>

<author>

    <name>YouDeal</name>

</author>

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

<Campaign xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/YouDeal/campaigns/1107642471864">

<Name>Capetown Daily</Name>

<Status>Draft</Status>

<Date>2011-09-15T11:09:07.279Z</Date>

<LastEditDate>2011-09-15T11:20:32.367Z</LastEditDate>

<Subject>Capetown Daily</Subject>

<FromName>YouDeal</FromName>

<CampaignType>CUSTOM</CampaignType>

<ViewAsWebpage>YES</ViewAsWebpage>

<ViewAsWebpageLinkText>Click here</ViewAsWebpageLinkText>

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

<GreetingSalutation>Dear</GreetingSalutation>

<GreetingName>FirstName</GreetingName>

     <GreetingString>Greetings!</GreetingString>

<OrganizationName>Youdeal</OrganizationName>

<OrganizationAddress1>test</OrganizationAddress1>

<OrganizationAddress2>test</OrganizationAddress2>

<OrganizationAddress3>test</OrganizationAddress3>

<OrganizationCity>test</OrganizationCity>

<OrganizationState>test</OrganizationState>     <OrganizationInternationalState>test</OrganizationInternationalState>     <OrganizationCountry>test</OrganizationCountry>

<OrganizationPostalCode>test</OrganizationPostalCode>     <IncludeForwardEmail>YES</IncludeForwardEmail>

<ForwardEmailLinkText>test</ForwardEmailLinkText>

<IncludeSubscribeLink>YES</IncludeSubscribeLink>

<SubscribeLinkText>test</SubscribeLinkText>

<EmailContentFormat>HTML</EmailContentFormat>

<EmailContent>&lt;html>&lt;head>&lt;title>Untitled Page&lt;/title>&lt;/head>&lt;body>&lt;p>Test new&lt;/p>&lt;/body>&lt;/html></EmailContent>

<EmailTextContent>&lt;Text>This is the text version.&lt;/Text></EmailTextContent>

<StyleSheet></StyleSheet>

<FromEmail>

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

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

</Email>

<EmailAddress>mail@youdeal.co.za</EmailAddress>

</FromEmail>

<ReplyToEmail>

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

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

</Email>

<EmailAddress>mail@youdeal.co.za</EmailAddress>

</ReplyToEmail>

</Campaign>

</content>

<source>

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

<title type="text">Capetown Daily</title>

<link href="campaigns" />

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

<author>

<name>YouDeal</name>

</author>

<updated>2011-09-15T11:20:32.396Z</updated>

</source>

</entry>

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