Where can I find campaign_activity_id

SamuelF543
Participant
0 Votes

Hello team,

 

I'm testing Send Email test through this url: 

https://v3.developer.constantcontact.com/api_reference/index.html#!/Email_Scheduling/testSendCampaig...

Asking campaign_activity_id there. But I didn't campaign_activity_id.

Help me to find campaign_activity_id.

 

Thanks,

Samuel

1 REPLY 1
Caleb_A
Moderator
0 Votes

Hello Samuel,

 

My name is Caleb and I am a member of Constant Contact's API Developer Support Team.

 

In order to retrieve the campaign_activity_id for a given campaign you will first need to retrieve the campaign_id for the campaign. If you are unfamiliar with how to find this then you will want to first make GET request to the endpoint '/emails' which will retrieve the collection of email campaigns from your account. The response you receive from this request will provide you the campaign_id unique to each campaign which will be needed in order to make the next request.

 

GET a Collection of Email Campaigns:
https://developer.constantcontact.com/api_reference/index.html#!/Email_Campaigns/retrieveEmailCampai...

 

Once you have retrieved the campaign_id for the campaign you will then want to make a new GET request to the endpoint '/emails/{campaign_id}'. This request will return all of the campaign_activity_id's for the specified campaign (minimum of two activity ids). The default activity id's have a role of either 'primary email' or 'permalink' (it is possible that you may have more activity ids if the campaign has been resent to non openers). Out of these activity_ids you will only need the activity_id with a role of 'primary email'.

 

GET Details About a Single Email Campaign:
https://developer.constantcontact.com/api_reference/index.html#!/Email_Campaigns/retrieveEmailCampai...

 

After retrieving the correct campaign_activity_id with a role of 'primary email' you will then be prepared to make a request to the endpoint '/emails/activities/{campaign_activity_id}/tests' which will then allow you to send a test email to the associated email_address in the body of the request.

 

POST Test Send an Email Campaign Activity:
https://v3.developer.constantcontact.com/api_reference/index.html#!/Email_Scheduling/testSendCampaig...


Regards,

Caleb A.
API Support Specialist

Did I answer your question?
If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.