cancel
Showing results for 
Search instead for 
Did you mean: 
Constant Contact wants to help you succeed! We’re celebrating our professional service programs on the Constant Contact Community this month and you have a chance to try one of the services for free! Learn more.

Add lists to campaign in API

SOLVED
Member

Add lists to campaign in API

Hi there,

 

I'm trying to create and send a campaign using your v2 API.

 

I am able to create a campaign by using a POST call as described here: https://developer.constantcontact.com/docs/email-campaigns/email-campaigns-collection.html?method=PO...

 

However, when I go to schedule the campaign by using a POST call with the returned id as described here: https://developer.constantcontact.com/docs/campaign-scheduling/campaign-schedule-collection.html?met...

 

I get the following error:

{ 
    error_key: 'http.status.bad_request',
    error_message: 'No contacts to send.'
}

Attempting to set the list id's with static list id values all fail.

 

How can I schedule a campaign by campaignID with a given listID?

Tags (2)
3 REPLIES 3
Highlighted
Moderator

Re: Add lists to campaign in API

Hello @JesseS442,

 

Thank you for reaching out to Constant Contact's API Support.

 

You need to set the contact listID in the same call that you create the email campaign, or you can make a PUT to update the email campaign and add the list after it is created.

 

Check this part of our documentation for "sent_to_contact_lists".

 

https://developer.constantcontact.com/docs/email-campaigns/email-campaigns-collection.html?method=PO...

 

Once the contact list is set then you should be able to schedule it without error.


Regards,
Jimmy D.
Tier II API Support Engineer
Member

Re: Add lists to campaign in API

Yes, I read through that very thoroughly many times before posting my question - nowhere on that page that you linked to does it mention the ability to set the list id's in a post request. In fact, in the "structure" table of that doc page, it says that the "sent_to_contact_lists" field is read only.

 

I'd like to point out that the API docs are very difficult to follow, and are unclear in many places. I've had to guess at several details and try many different things until I achieved success. It honestly made me heavily consider switching away from Constant Contact to something that is more user friendly.

 

Anyways, to the point of this post, you did answer my question, to which I am grateful. Thank you!

Moderator

Re: Add lists to campaign in API

Hi @JesseS442,

 

I do not recall that always being set to read only. I will check our previous versions to see if/when we changed it and see if we can get it set correctly.

 

We are always happy to hear any feedback on our documentation so that we can improve it. You can post the feedback here or email us at webservices(at)constantcontact(dot)com.


Regards,
Jimmy D.
Tier II API Support Engineer