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.

Updating email campaigns, I keep on getting 400 Bad Request Errors

Highlighted
Occasional Contributor

Updating email campaigns, I keep on getting 400 Bad Request Errors

Hi Everyone,

 

I am trying to update email campaign but i keep on getting 400 bad request errors.

 

any ideas?

 

here is my xml

<?xml version='1.0' encoding='UTF-8'?><entry xmlns="http://www.w3.org/2005/Atom">
    <link href="/ws/customers/user1/campaigns/1105175113425" rel="edit" />
    <id>http://api.constantcontact.com/ws/customers/user1/campaigns/1105175113425</id>
    <title type="text">Surebaby Week 4</title>
    <updated>2011-04-14T17:42:40.9527952Z</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/user1/campaigns/1105175113425" >
            <Name>Surebaby Week 4</Name>
            <Status>Draft</Status>
            <Date>2011-04-14T17:29:36.6960000Z</Date>
            <LastEditDate>2011-04-14T17:42:40.4020000Z</LastEditDate>
            <Sent>0</Sent>
            <Opens>0</Opens>
            <Clicks>0</Clicks>
            <Bounces>0</Bounces>
            <Forwards>0</Forwards>
            <OptOuts>0</OptOuts>
            <SpamReports>0</SpamReports>
            <CampaignType>CUSTOM</CampaignType>
            <Subject>Enter email subject here</Subject>
            <FromName>Clinical Study Connect</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>Greetings!</GreetingString>
            <OrganizationName>Tsavo Media</OrganizationName>
            <OrganizationAddress1>503 Imperial Road North</OrganizationAddress1>
            <OrganizationAddress2></OrganizationAddress2>
            <OrganizationAddress3></OrganizationAddress3>
            <OrganizationCity>Guelph</OrganizationCity>
            <OrganizationState></OrganizationState>
            <OrganizationInternationalState>Ontario</OrganizationInternationalState>
            <OrganizationCountry>ca</OrganizationCountry>
            <OrganizationPostalCode>N1H 6T9</OrganizationPostalCode>
            <IncludeForwardEmail>YES</IncludeForwardEmail>
            <ForwardEmailLinkText>Forward email</ForwardEmailLinkText>
            <IncludeSubscribeLink>YES</IncludeSubscribeLink>
            <SubscribeLinkText>Subscribe me!</SubscribeLinkText>
            <EmailContentFormat>HTML</EmailContentFormat>
            <EmailContent>
                &lt;html lang=&quot;en&quot; xml:lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:cctd=&quot;http://www.constantcontact.com/cctd&quot;&gt;


                &lt;body&gt;&lt;CopyRight&gt;Copyright (c) 1996-2005 Roving Software Incorporated d/b/a Constant Contact. All rights reserved.  Except as permitted under a separate
                written 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 the
                prior written permission of Constant Contact.  For inquiries regarding reproduction or distribution of any Constant Contact material, please
                contact legal@constantcontact.com.&lt;/CopyRight&gt;
                &lt;OpenTracking/&gt;
                &lt;!--  Do NOT delete previous line if you want to get statistics on the number of opened emails --&gt;


                &lt;CustomBlock name=&quot;letter.intro&quot; title=&quot;Personalization&quot;&gt;
                &lt;Greeting/&gt;
                &lt;/CustomBlock&gt;


                &lt;/body&gt;
                &lt;/html&gt;
            </EmailContent>
            <EmailTextContent>&lt;Text&gt;&lt;Greeting/&gt;&lt;/Text&gt;</EmailTextContent>
            <StyleSheet></StyleSheet>
            <ContactLists>
                <ContactList id="http://api.constantcontact.com/ws/customers/user1/lists/81">
                    <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/user1/lists/81" rel="self" />
                </ContactList>
                <ContactList id="http://api.constantcontact.com/ws/customers/user1/lists/82">
                    <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/user1/lists/82" rel="self" />
                </ContactList>
                <ContactList id="http://api.constantcontact.com/ws/customers/user1/lists/83">
                    <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/user1/lists/83" rel="self" />
                </ContactList>
                <ContactList id="http://api.constantcontact.com/ws/customers/user1/lists/84">
                    <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/user1/lists/84" rel="self" />
                </ContactList>
                <ContactList id="http://api.constantcontact.com/ws/customers/user1/lists/85">
                    <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/user1/lists/85" rel="self" />
                </ContactList>
            </ContactLists>
            <FromEmail>
                <Email id="http://api.constantcontact.com/ws/customers/user1/settings/emailaddresses/0">
                    <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/user1/settings/emailaddresses/0" rel="self" />
                </Email>
                <EmailAddress></EmailAddress>
            </FromEmail>
            <ReplyToEmail>
                <Email id="http://api.constantcontact.com/ws/customers/user1/settings/emailaddresses/0">
                    <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/user1/settings/emailaddresses/0" rel="self" />
                </Email>
                <EmailAddress></EmailAddress>
            </ReplyToEmail>
        </Campaign>
    </content>
    <source>
        <id>http://api.constantcontact.com/ws/customers/user1/campaigns</id>
        <title type="text">Campaigns for customer: user1</title>
        <link href="campaigns" />
        <link href="campaigns" rel="self" />
        <author>
            <name>user1</name>
        </author>
        <updated>2011-04-14T17:42:41.8897952Z</updated>
    </source>
</entry>

Tags (1)
2 REPLIES 2
Highlighted
Occasional Contributor

Re: Updating email campaigns, I keep on getting 400 Bad Request Errors

whats am i doing wrong with my xml put ?

Highlighted
Employee

Re: Updating email campaigns, I keep on getting 400 Bad Request Errors

Hi Chris,

 

I was able to use the XML that you posted to update a campaign in my account with only a few modifications, all of which were account created rather than structural. Without having access to your account and campaign, it makes it difficult say to for sure what would be causing the issue, but I would start by looking at:

 

1) You are referencing verified email address id 0 as your from and reply addresses on this email. The first possible verified address in the account is id 1. You can find more information about this in Retrieving Account Email Addresses.

 

2) Do you have list ID's 81-85 in your account, as you are telling this campaign to include these lists? You can find out which lists you have in your account by Retrieving a Contact List Collection.

 

David J

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