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: Invalid Content while creating Campaign

SOLVED
Go to solution
Highlighted
Occasional Contributor

Error 400: Invalid Content while creating Campaign

could you please help me where the error is

 

 

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
    <link  href="/ws/customers/rakesh286@gmail.com/campaigns" rel="edit" />
    <id>http://api.constantcontact.com/ws/customers/rakesh286@gmail.com/campaigns</id>
    <title type="text">nwe campiagn</title>
    <updated>2013-04-04T14:21:06.407Z</updated>
    <author>
        <name>rakesh</name>
    </author>
    <content type="application/vnd.ctct+xml">
        <Campaign  xmlns="http://ws.constantcontact.com/ns/1.0/">
            <Name>rakeshcamp</Name>
            <Status>Draft</Status>
            <Date>2013-04-04T14:21:06.407Z</Date>
            <Subject>rakeshcam</Subject>
            <FromName>rakesh</FromName>
            <ViewAsWebpage>NO</ViewAsWebpage>
            <ViewAsWebpageLinkText />
            <ViewAsWebpageText />
            <PermissionReminder>NO</PermissionReminder>
            <PermissionReminderText />
            <GreetingSalutation>dear</GreetingSalutation>
            <GreetingName>FirstName</GreetingName>
            <GreetingString>rakesh</GreetingString>
            <OrganizationName>rakeshhouse</OrganizationName>
            <OrganizationAddress1>123</OrganizationAddress1>
            <OrganizationAddress2>456</OrganizationAddress2>
            <OrganizationAddress3>234</OrganizationAddress3>
            <OrganizationCity>hyd</OrganizationCity>
            <OrganizationState>AP</OrganizationState>
            <OrganizationInternationalState>in</OrganizationInternationalState>
            <OrganizationCountry>us</OrganizationCountry>
            <OrganizationPostalCode>500987</OrganizationPostalCode>
            <IncludeForwardEmail>NO</IncludeForwardEmail>
            <ForwardEmailLinkText />
            <IncludeSubscribeLink>NO</IncludeSubscribeLink>
            <SubscribeLinkText />
            <EmailContentFormat>HTML</EmailContentFormat>
            <EmailContent>&amp;lt;html&amp;gt;          &amp;lt;body&amp;gt;Hello!          &amp;lt;/body&amp;gt;        &amp;lt;/html&amp;gt;</EmailContent>
            <EmailTextContent>&amp;lt;Text&gt;hello&amp;lt;/Text&gt;</EmailTextContent>
            <StyleSheet />
            <ContactLists>
                <ContactList id="http://api.constantcontact.com/ws/customers/rakesh286@gmail.com/lists/1">
                    <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/rakesh286@gmail.com/lists/1" rel="self" />
                </ContactList>
            </ContactLists>
            <FromEmail>
                <Email id="http://api.constantcontact.com/ws/customers/rakesh286@gmail.com/settings/emailaddresses/1">
                    <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/rakesh286@gmail.com/settings/emailaddresses/1" rel="self" />
                </Email>
                <EmailAddress>rakesh286@gmail.com</EmailAddress>
            </FromEmail>
            <ReplyToEmail>
                <Email id="http://api.constantcontact.com/ws/customers/rakesh286@gmail.com/settings/emailaddresses/1">
                    <link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/rakesh286@gmail.com/settings/emailaddresses/1" rel="self" />
                </Email>
                <EmailAddress>rakesh286@gmail.com</EmailAddress>
            </ReplyToEmail>
        </Campaign >
    </content>
    <source>
        <id>http://api.constantcontact.com/ws/customers/rakesh286@gmail.com/campaigns</id>
        <title type="text">nwe campiagn</title>
        <link  href="campaigns" />
        <link  href="campaigns" rel="self" />
        <author>
            <name>rakesh</name>
        </author>
        <updated>2013-04-04T14:21:06.407Z</updated>
    </source>
</entry>

 

 

thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Employee

Re: Error 400: Invalid Content while creating Campaign

Sorry about that, I did have to change the EmailContent and EmailTextContent as follows:

 

<EmailContent>&lt;html&gt; &lt;body&gt;Hello! &lt;/body&gt; &lt;/html&gt;</EmailContent>
<EmailTextContent>text</EmailTextContent>

 

Best Regards,

Shannon W.

API Support Specialist

View solution in original post

4 REPLIES 4
Highlighted
Employee

Re: Error 400: Invalid Content while creating Campaign

Hi,

 

The error appears to have been with the contents of the EmailTextContent node.  If you replace the contents with something simple, like "Hi There", omitting the encoded <Text> tags, the payload should work.

 

Best Regards,

Shannon W.

API Support Specialist

Highlighted
Occasional Contributor

Re: Error 400: Invalid Content while creating Campaign

thanks for the reply Shannon

 

After replacping the EmailTextContent  Node still i am getting the error 400 Invaild Content

Highlighted
Employee

Re: Error 400: Invalid Content while creating Campaign

Sorry about that, I did have to change the EmailContent and EmailTextContent as follows:

 

<EmailContent>&lt;html&gt; &lt;body&gt;Hello! &lt;/body&gt; &lt;/html&gt;</EmailContent>
<EmailTextContent>text</EmailTextContent>

 

Best Regards,

Shannon W.

API Support Specialist

View solution in original post

Highlighted
Occasional Contributor

Re: Error 400: Invalid Content while creating Campaign

thanks for the reply Shannon

 

its working :) :)

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