We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

403 Access Denied when trying to schedule a campaign thru API

Occasional Participant

403 Access Denied when trying to schedule a campaign thru API

I am trying to create a campaign and schedule it for delivery in future thru the API. The campaign gets created fine but scheduling fails with 403 Access Denied error. I get an HTML response back which looks like this:




There are 2 issues:

  1. I am not sure why I am not getting access denied when reacting campaign but only when scheduling.
  2. The HTML response is an invalid HTML. It has an <HR> tag that doesn't finish. So, XML parser on my end trips up.

#1 is higher priority for me to resolve. #2 may be a red-herring but I'd like to resolve it so my client doesn't get tripped up and can decipher 403 access denied message.

Occasional Participant

I found this thread which is relevant. http://community.constantcontact.com/t5/Developer-Support-ask-questions/API-scheduling-gives-HTTP-St...


I am going to followup on specified email.


The 403 when scheduling is most likely caused by what you found, you have not been provided scheduling API access for your API key.  Sending in that email will start the access process and get you past the 403.


The XML parsing issue is a little trickier.  The HTML content sent to use and returned from us through the API must be XML encoded, since it is XML payload and not XML nodes.  If you encode the HTML content, the <hr> tag will become &gt;ht&lt; and no longer cause XML parsing errors since it doesn't trigger as an XML node.  The solution, and requirement, is to treat everything within the <EmailContent> and <EmailTextContent> nodes as XML encoded content.  If you do this, you should get passed the parsing errors.


If that doesn't solve your problem, please respond with your XML that is failing XML parsing (and please remove any personally identifiable information such as email, username, etc.).  We can look at your XML and see what is going on.

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

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

Visit Page