Using the API Schedule Campaigns

Highlighted
Occasional Advisor

Using the API Schedule Campaigns

I am trying to use the API to do the following


1. Create the list


2. Upload contacts (it may take several times as the lists are larger than 20K)


3. Create Campaign


4. Schedule Campaign


I had this working and then last thursday the scheduling part stopped working for the most part. Occasionally it works, but usually it doesn't. The fact that it sometimes works has me very confused as I am always doing the same steps.


 


My XML doesn't even work in the REST client. I get back "Error 400: No contacts to send." Even though I have just created the list and added contacts to it. When I check on ConstantContact.com I can see the list and contacts.


Here is my XML:


<entry xmlns="http://www.w3.org/2005/Atom"><link href="/ws/customers/Nightingalenurses/campaigns/1103687326080/schedules/1" rel="edit" /><id>http://api.constantcontact.com/ws/customers/Nightingalenurses/campaigns/1103687326080/schedules/1</id><title>Today's Schedule</title><updated>2010-09-14T11:50:00.000Z</updated><author><name>API</name></author><content type="application/vnd.ctct+xml"><Schedule xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/Nightingalenurses/campaigns/1103687326080/schedules/1"><...>


 


Does anyone have any ideas of what could be causing this intermittant issue?

2 REPLIES 2
Highlighted
CTCT Employee

scheduling error in rest client and code

Hello,



I received your most recent email and I am going to be responding to you personally in a few moments. If you have any questions please let me know.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Highlighted
Occasional Advisor

I figured out this on my own

I figured I would post here in case it can help someone else.


Basically I was scheduling several emails to go out in a row and even though I got the response that the list was uploaded, it was actually creating a backlog in the activities. So when I had a large list it was still working on that list and then when created a new list, uploaded contacts and tried to schedule it since there was a long list of items in the activities there wasn't any contacts in my second email list.


So now what I am doing is before I try to schedule the campaign I am checking the activity list and if there is anything on the list that is not complete then I wait and check the activity list in 40 seconds.


I know there is probably is a better way (maybe check the contact list before I schedule to see how many contacts and wait if it is 0), but this is how I got it working for now.


 

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