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.

BAD Reuqest on campaign.. spent 2 days

Highlighted
Occasional Participant

BAD Reuqest on campaign.. spent 2 days

Hi,

 

I have already spent 2 days to solve this but no luck... can any one please help me. Dave if you can just point out what i am doing wrong it will be great help.

 

<entryxmlns="http://www.w3.org/2005/Atom">
<linkhref="/ws/customers/username/campaigns"rel="edit"/>
<id>http://api.constantcontact.com/ws/customers/username/campaigns</id>
<titletype="text">test</title>
<updated>2012-09-10T11:24:10.763Z</updated>
<author>
<name>Constant Contact</name>
</author>
<contenttype="application/vnd.ctct+xml">
<Campaignxmlns="http://ws.constantcontact.com/ns/1.0/"id="http://api.constantcontact.com/ws/customers/username/campaigns/0000000000000">
<Name>test</Name>
<Status>Draft</Status>
<Date>2012-09-10T11:24:10.763Z</Date>
<Subject>test</Subject>
<FromName>from name</FromName>
<ViewAsWebpage>NO</ViewAsWebpage>
<ViewAsWebpageLinkText/>
<ViewAsWebpageText/>
<PermissionReminder>NO</PermissionReminder>
<PermissionReminderText/>
<GreetingSalutation>Dear</GreetingSalutation>
<GreetingString>Greetings!</GreetingString>
<OrganizationName>amies</OrganizationName>
<OrganizationAddress1>newport beach</OrganizationAddress1>
<OrganizationAddress2/>
<OrganizationAddress3/>
<OrganizationCity>newport</OrganizationCity>
<OrganizationState>CA</OrganizationState>
<OrganizationInternationalState/>
<OrganizationCountry>us</OrganizationCountry>
<OrganizationPostalCode>92657</OrganizationPostalCode>
<IncludeForwardEmail>NO</IncludeForwardEmail>
<ForwardEmailLinkText/>
<IncludeSubscribeLink>NO</IncludeSubscribeLink>
<SubscribeLinkText/>
<GreetingName>FirstName</GreetingName>
<EmailContentFormat>HTML</EmailContentFormat>
<EmailContent>This is test</EmailContent>
<EmailTextContent>Amiescommuncation</EmailTextContent>
<StyleSheet/>
<ContactLists>
<ContactListid="http://api.constantcontact.com/ws/customers/username/lists/2"><linkxmlns="http://www.w3.org/2005/Atom"href="http://api.constantcontact.com/ws/customers/username/lists/2"rel="self"/></ContactList><ContactListid="http://api.constantcontact.com/ws/customers/username/lists/3"><linkxmlns="http://www.w3.org/2005/Atom"href="http://api.constantcontact.com/ws/customers/username/lists/3"rel="self"/></ContactList>
</ContactLists>
<FromEmail>
<Emailid="http://api.constantcontact.com/ws/customers/username/settings/emailaddresses/1">
<linkxmlns="http://www.w3.org/2005/Atom"href="/ws/customers/username/settings/emailaddresses/1"rel="self"/>
</Email>
<EmailAddress>username@gmail.com</EmailAddress>
</FromEmail>
<ReplyToEmail>
<Emailid="http://api.constantcontact.com/ws/customers/username/settings/emailaddresses/1">
<linkxmlns="http://www.w3.org/2005/Atom"href="/ws/customers/username/settings/emailaddresses/1"rel="self"/>
</Email>
<EmailAddress>username@gmail.com</EmailAddress>
</ReplyToEmail>
</Campaign>
</content>
<source>
<id>http://api.constantcontact.com/ws/customers/username/campaigns</id>
<titletype="text">Campaigns for customer: username</title>
<linkhref="campaigns"/>
<linkhref="campaigns"rel="self"/>
<author>
<name>username</name>
</author>
<updated>2012-09-10T11:24:10.763Z</updated>
</source>
</entry>

4 REPLIES 4
Highlighted
Employee

Re: BAD Reuqest on campaign.. spent 2 days

Hi,

 

Sorry, it seems that I might have missed your email to me previously.  The problem with your xml mostly had to do with needing spaces between values, like in the entry, link, and title nodes.  You also have to have content in the email content nodes, so I put something in there.  

 

I also removed your personal details from your post for your security, but you may want to change your username since it was on the board for a little while.  Try using this XML and see if you have better luck:  I used it in my account to create an email, and it posted successfully:

 

<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">test</title>
<updated>2012-09-10T11:24:10.763Z</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/000">
<Name>Email Name Here</Name>
<Status>Draft</Status>
<Date>2012-09-10T11:24:10.763Z</Date>
<Subject>test</Subject>
<FromName>from name</FromName>
<ViewAsWebpage>NO</ViewAsWebpage>
<ViewAsWebpageLinkText/>
<ViewAsWebpageText/>
<PermissionReminder>NO</PermissionReminder>
<PermissionReminderText/>
<GreetingSalutation>Dear</GreetingSalutation>
<GreetingString>Greetings!</GreetingString>
<GreetingName>FirstName</GreetingName>
<OrganizationName>amies</OrganizationName>
<OrganizationAddress1>newport beach</OrganizationAddress1>
<OrganizationAddress2/>
<OrganizationAddress3/>
<OrganizationCity>newport</OrganizationCity>
<OrganizationState>CA</OrganizationState>
<OrganizationInternationalState/>
<OrganizationCountry>us</OrganizationCountry>
<OrganizationPostalCode>92657</OrganizationPostalCode>
<IncludeForwardEmail>NO</IncludeForwardEmail>
<ForwardEmailLinkText/>
<IncludeSubscribeLink>NO</IncludeSubscribeLink>
<SubscribeLinkText/>
<EmailContentFormat>HTML</EmailContentFormat>
<EmailContent>&lt;html>
          &lt;body>Hello!
          &lt;/body>
        &lt;/html></EmailContent>
<EmailTextContent>Amiescommuncation</EmailTextContent>
<StyleSheet/>
<ContactLists>
<ContactList id="http://api.constantcontact.com/ws/customers/username/lists/1"><link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/username/lists/1" rel="self"/></ContactList><ContactList id="http://api.constantcontact.com/ws/customers/username/lists/2"><link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/username/lists/2" rel="self"/></ContactList>
</ContactLists>
<FromEmail>
<Email id="http://api.constantcontact.com/ws/customers/username/settings/emailaddresses/1">
<link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/username/settings/emailaddresses/1" rel="self"/>
</Email>
<EmailAddress>example@example.com</EmailAddress>
</FromEmail>
<ReplyToEmail>
<Email id="http://api.constantcontact.com/ws/customers/username/settings/emailaddresses/1">
<link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/username/settings/emailaddresses/1" rel="self"/>
</Email>
<EmailAddress>example@example.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>2012-09-10T11:24:10.763Z</updated>
</source>
</entry>

 

Best Regards,

Shannon W.

API Support Specialist

Highlighted
Occasional Participant

Re: BAD Reuqest on campaign.. spent 2 days

Thanks for reply.. Spaces where bcoz of forum editor .. when i pasted into it.. any ways i used xml u posted just modified username but yet can not solve the issue .. yet bad request. .. posting xml again below .. can u see and other issues ?  <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'>test</title> <updated>2012-09-10T11:24:10.763Z</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/000'> <Name>Email Name Here</Name> <Status>Draft</Status> <Date>2012-09-10T11:24:10.763Z</Date> <Subject>test</Subject> <FromName>from name</FromName> <ViewAsWebpage>NO</ViewAsWebpage> <ViewAsWebpageLinkText/> <ViewAsWebpageText/> <PermissionReminder>NO</PermissionReminder> <PermissionReminderText/> <GreetingSalutation>Dear</GreetingSalutation> <GreetingString>Greetings!</GreetingString> <GreetingName>FirstName</GreetingName> <OrganizationName>amies</OrganizationName> <OrganizationAddress1>newport beach</OrganizationAddress1> <OrganizationAddress2/> <OrganizationAddress3/> <OrganizationCity>newport</OrganizationCity> <OrganizationState>CA</OrganizationState> <OrganizationInternationalState/> <OrganizationCountry>us</OrganizationCountry> <OrganizationPostalCode>92657</OrganizationPostalCode> <IncludeForwardEmail>NO</IncludeForwardEmail> <ForwardEmailLinkText/> <IncludeSubscribeLink>NO</IncludeSubscribeLink> <SubscribeLinkText/> <EmailContentFormat>HTML</EmailContentFormat> <EmailContent>&lt;html> &lt;body>Hello! &lt;/body> &lt;/html></EmailContent> <EmailTextContent>Amiescommuncation</EmailTextContent> <StyleSheet/> <ContactLists> <ContactList id='http://api.constantcontact.com/ws/customers/username/lists/1'><link xmlns='http://www.w3.org/2005/Atom' href='/ws/customers/username/lists/1' rel='self'/></ContactList> <ContactList id='http://api.constantcontact.com/ws/customers/username/lists/2'><link xmlns='http://www.w3.org/2005/Atom' href='/ws/customers/username/lists/2' rel='self'/></ContactList> </ContactLists> <FromEmail> <Email id='http://api.constantcontact.com/ws/customers/username/settings/emailaddresses/1'> <link xmlns='http://www.w3.org/2005/Atom' href='/ws/customers/username/settings/emailaddresses/1' rel='self'/> </Email> <EmailAddress>example@example.com</EmailAddress> </FromEmail> <ReplyToEmail> <Email id='http://api.constantcontact.com/ws/customers/username/settings/emailaddresses/1'> <link xmlns='http://www.w3.org/2005/Atom' href='/ws/customers/username/settings/emailaddresses/1' rel='self'/> </Email> <EmailAddress>example@example.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>2012-09-10T11:24:10.763Z</updated> </source> </entry>

Highlighted
Occasional Participant

Re: BAD Reuqest on campaign.. spent 2 days

Thanks, I got the solution... i was using email address which was not verified. ... I got this when i tried it from REST client. For other who will find this post .. suggestion .. PLEASE USE REST CLIENT TO TEST YOUT XML.

Highlighted
Employee

Re: BAD Reuqest on campaign.. spent 2 days

Hi,

 

Thanks for the update; I'm glad you found the issue!  Good suggestion about using RESTClient to test.  Here is a link to RESTClient.

 

Best Regards,

Shannon W.

API Support Specialist

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