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, please check my xml

Highlighted
Occasional Participant

400 Error, please check my xml

Hey i will need you guys to look at my xml, it's not valid i guess. FYI: I am trying to create a campaign. Maybe in future instead of http errors it should return compiler-like errors to make it easier for developers.


<?xml version="1.0" encoding="UTF-8"?>

<entry xmlns="http://www.w3.org/2005/Atom">
<link href="/ws/customers/stanxp4/campaigns" rel="edit" />
<id>http://api.constantcontact.com/ws/customers/stanxp4/campaigns</id>
<title type="text">cmp_name</title>
<updated>2010-09-28T05:22:42+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/stanxp4/campaigns/1100546096289">
<Name>cmp_name</Name>
<Status>Draft</Status>


<Date>2010-09-28T05:22:42 01:00</Date>
<Subject>cmp_subject</Subject>
<FromName>cmp_from_name</FromName>
<ViewAsWebpage>NO</ViewAsWebpage>
<ViewAsWebpageLinkText>
</ViewAsWebpageLinkText>
<ViewAsWebpageText>
</ViewAsWebpageText>
<PermissionReminder>NO</PermissionReminder>
<PermissionReminderText>
</PermissionReminderText>
<GreetingSalutation>


</GreetingSalutation>
<GreetingName>cmp_grt_name</GreetingName>
<GreetingString>cmp_grt_str</GreetingString>
<OrganizationName>cmp_org_name</OrganizationName>
<OrganizationAddress1>cmp_org_addr1</OrganizationAddress1>
<OrganizationAddress2>
</OrganizationAddress2>
<OrganizationAddress3>
</OrganizationAddress3>
<OrganizationCity>cmp_org_city</OrganizationCity>
<OrganizationState>
</OrganizationState>


<OrganizationInternationalState>
</OrganizationInternationalState>
<OrganizationCountry>us</OrganizationCountry>
<OrganizationPostalCode>123</OrganizationPostalCode>
<IncludeForwardEmail>NO</IncludeForwardEmail>
<ForwardEmailLinkText>
</ForwardEmailLinkText>
<IncludeSubscribeLink>NO</IncludeSubscribeLink>
<SubscribeLinkText>
</SubscribeLinkText>
<EmailContentFormat>HTML</EmailContentFormat>
<EmailContent>&lt;html>&lt;body>body&lt;/body>&lt;/html>


</EmailContent>
<EmailTextContent>&lt;Text>&lt;/Text>
</EmailTextContent>
<StyleSheet>
</StyleSheet>
<ContactLists>
<ContactList id="http://api.constantcontact.com/ws/customers/stanxp4/lists/11">
<link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/stanxp4/lists/11" rel="self" />
</ContactList>
</ContactLists>
<FromEmail>
<Email id="http://api.constantcontact.com/ws/customers/stanxp4/settings/emailaddresses/2">
<link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/stanxp4/settings/emailaddresses/2" rel="self" />
</Email>
<EmailAddress>stanw32@gmail.com</EmailAddress>


</FromEmail>
<ReplyToEmail>
<Email id="http://api.constantcontact.com/ws/customers/stanxp4/settings/emailaddresses/2">
<link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/stanxp4/settings/emailaddresses/2" rel="self" />
</Email>
<EmailAddress>stanw32@gmail.com</EmailAddress>
</ReplyToEmail>
</Campaign>
</content>
<source>
<id>http://api.constantcontact.com/ws/customers/stanxp4/campaigns</id>
<title type="text">Campaigns for customer: stanxp4</title>
<link href="campaigns" />
<link href="campaigns" rel="self" />


<author>
<name>stanxp4</name>
</author>
<updated>2010-09-28T05:22:42+01:00</updated>
</source>
</entry>

6 REPLIES 6
Highlighted
Employee

Re: 400 Error, please check my xml

This is very close. I only needed to make two minor adjustments for this to create a campaign in my account.


 


1. Greeting Name: 'cmp_grt_name' is not a valid greeting name. You would need to modify this to a valid name, which you can see by looking at our Campaign Data XML Elements Specification. Valid options are FirstName, LastName, FirstAndLastName, None.


 


2. I do not see an OrganizationState, but this field is required. If you change this to use a state code such as "MA" or "TX" - this should be resolved.


 


Once you have made these changes this should create an email in your account. Please let me know if this does not resolves your issue with creating a campaign, and I'll be happy to take a look. Thanks.

David J

Highlighted
Occasional Participant

Thanks David, These two

Thanks David,


These two changes made it work correctly! Now i am after new thing, i want to schedule the campaign, when i set <Status>Scheduled</Status> and set <Date></Date> it doesn't schedule the email, it always make it Draft.


Best Regards,

Stan.

Highlighted
Employee

Scheduling API

Hello Stan,



We do allow scheduling campaigns, but it is a little different than updating the campaign to a scheduled status. Currently everyone who would like to use our scheduling API needs to get prior approval from our AppConnect team. If you email them here, they can send you over the documentation on how to schedule emails in the API.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Highlighted
Occasional Participant

Hey, Well i will tell my

Hey,



Well i will tell my client to contact your AppConnect team and ask for approval, then i will be back for a little more begging for help on the forums ;) Great support by the way!



Best Regards,

Stan.

 

Highlighted
Occasional Participant

403 error on Scheduling Campaign

Hey, me again,


My client contacted the AppConnect team and i was able to read the documentation on how to Schedule a campaign however now i am receving 403 errors when i try to send my request to https://api.constantcontact.com/ws/customers/stanxp4/campaigns/1103723472648/schedules

Since you need approval from AppConnect team i was expecting to pass me some new API key but he didn't mention of AppConnect team giving him some special api key or something like that. What might be causing this error?


Best Regards,

Stan.

Highlighted
Occasional Advisor

403 Error

Hello Stan,


If you did, in fact, receive permission to use the scheduler API and documentation, you should not be receiving a 403 error. To further investigate this issue and to confirm that you do indeed have access to the scheduler API, please email the webservices support team with your Username and API key.


 


 

Andrew T

Support Engineer, Constant Contact

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