ConstantContact's own code samples throw an error

Regular Participant

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
Moderator

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