ConstantContact's own code samples throw an error

Highlighted
Occasional Contributor

ConstantContact's own code samples throw an error

At http://community.constantcontact.com/t5/Documentation/Creating-a-Campaign/ba-p/25047 we are provided a code sample that can be used for creating a new campaign. However, when I copy and paste that code sample so that it can be posted to https://api.constantcontact.com/ws/cusotmers/{username}/campaigns (along with a Content-type parameter set to application/atom+xml) I get the following error in response:

 

Error 400: ...Element "Email cannot have character [children], because the type's content type is element-only. Error: ...Element 'FromEmail' cannot have character [children], because the type's content type is element-only.... Element "ReplyToEmail' cannot have character [children], because the type's content type is element-only.

 

How can this be fixed?

 

 

1 REPLY 1
Highlighted
Moderator

Re: ConstantContact's own code samples throw an error

Thanks for pointing out the error.  It was caused by a formatting issue in line returns.  I updated the XML and the documentation to remove the line returns that caused the problem, the example works correctly now.  I have noticed subtle differences in copy/paste of the sample depending on which browser I used but that shouldn't cause you any problems. 

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact Would Like To Hear From You!

We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...

Read More
Featured