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 when creating campaign

SOLVED
Go to solution
Highlighted
Occasional Advisor

400 error when creating campaign

I am using the following XML to attempt to create a campaign but I just can't seem to get it to work. I get a 400 error no matter what I do (I replaced personal info with info like "Company Zip" etc):

 

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
      <link href="/ws/customers/UserName/campaigns" rel="edit"/>
      <id>http://api.constantcontact.com/ws/customers/UserName/campaigns</id>
      <title type="text">test2</title>
      <updated>2011-06-06T12:10:12+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/UserName/campaigns/1100546096289">
                  <Name>test2</Name>
                  <Status>draft</Status>
                  <Date>2011-06-07T12:10:12+01:00</Date>
                  <Subject>Test Email</Subject>
                  <FromName>Company, LLC</FromName>
                  <ViewAsWebpage>YES</ViewAsWebpage>
                  <ViewAsWebpageLinkText></ViewAsWebpageLinkText>
                  <ViewAsWebpageText></ViewAsWebpageText>
                  <PermissionReminder>NO</PermissionReminder>
                  <PermissionReminderText></PermissionReminderText>
                  <GreetingSalutation>Dear</GreetingSalutation>
                  <GreetingName>FirstName</GreetingName>
                  <GreetingString>Greetings!</GreetingString>
                  <OrganizationName>Company Name</OrganizationName>
                  <OrganizationAddress1>Company Address</OrganizationAddress1>
                  <OrganizationAddress2></OrganizationAddress2>
                  <OrganizationAddress3></OrganizationAddress3>
                  <OrganizationCity>Company City</OrganizationCity>
                  <OrganizationState>Company State</OrganizationState>
                  <OrganizationInternationalState></OrganizationInte

rnationalState>
                  <OrganizationCountry>us</OrganizationCountry>
                  <OrganizationPostalCode>Company Zip</OrganizationPostalCode>
                  <IncludeForwardEmail>NO</IncludeForwardEmail>
                  <ForwardEmailLinkText>Forward email</ForwardEmailLinkText>
                  <IncludeSubscribeLink>NO</IncludeSubscribeLink>
                  <SubscribeLinkText>Subscribe me!</SubscribeLinkText>
                  <EmailContentFormat>HTML</EmailContentFormat>
                  <EmailContent>
                        <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:cctd="http://www.constantcontact.com/cctd">
                              <body>
                                    <CopyRight>Copyright (c) 1996-2011 Constant Contact. All rights reserved. Except as permitted under a separatewritten agreement with Constant Contact, neither the Constant Contact software, nor any content that appears on any Constant Contact site,including but not limited to, web pages, newsletters, or templates may be reproduced, republished, repurposed, or distributed without theprior written permission of Constant Contact. For inquiries regarding reproduction or distribution of any Constant Contact material, pleasecontact legal@constantcontact.com.</CopyRight>
                                    <OpenTracking/>
                                    <!-- Do NOT delete previous line if you want to get statistics on the number of opened emails -->
                                    <CustomBlock name="letter.intro" title="Personalization">
                                          <Greeting/>
                                    </CustomBlock>
                              Hi there!</body>
                        </html>
                  </EmailContent>
                  <EmailTextContent>
                        <Text>
                              <Greeting/>
                        Hi there!</Text>
                  </EmailTextContent>
                  <StyleSheet></StyleSheet>
                  <ContactLists>
                        <ContactList id="http://api.constantcontact.com/ws/customers/UserName/lists/59">
                              <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/UserName/lists/59" rel="self"/>
                        </ContactList>
                  </ContactLists>
                  <FromEmail>
                        <Email id="http://api.constantcontact.com/ws/customers/UserName/settings/emailaddresses/2">
                              <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/UserName/settings/emailaddresses/2" rel="self"/>
                        </Email>
                        <EmailAddress>me@me.com</EmailAddress>
                  </FromEmail>
                  <ReplyToEmail>
                        <Email id="http://api.constantcontact.com/ws/customers/UserName/settings/emailaddresses/2">
                              <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/UserName/settings/emailaddresses/2" rel="self"/>
                        </Email>
                        <EmailAddress>me@me.com</EmailAddress>
                  </ReplyToEmail>
            </Campaign>
      </content>
      <source>
            <id>http://api.constantcontact.com/ws/customers/UserName/campaigns</id>
            <title type="text">Campaigns for customer: UserName</title>
            <link href="campaigns"/>
            <link href="campaigns" rel="self"/>
            <author>
                  <name>UserName</name>
            </author>
            <updated>2011-06-06T12:10:12</updated>
      </source>
</entry>

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Employee

Re: 400 error when creating campaign

This is being addressed in thread:

http://community.constantcontact.com/t5/Authentication-and-Access-ie-401/Updating-Copying-Campaign/m...

 

Regards,

Benjamin Soder
NOC Analyst
Constant Contact

View solution in original post

1 REPLY 1
Highlighted
Employee

Re: 400 error when creating campaign

This is being addressed in thread:

http://community.constantcontact.com/t5/Authentication-and-Access-ie-401/Updating-Copying-Campaign/m...

 

Regards,

Benjamin Soder
NOC Analyst
Constant Contact

View solution in original post

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