Make a POST call to the /emails/activities/{campaign_activity_id}/schedules
endpoint to schedule an email campaign activity.
You must specify which contacts you want to receive an email campaign activity before you schedule it. Use PUT /emails/activities/{campaign_activity_id}
to add contacts to an email campaign activity using the contact_list_ids
array or the segments_ids
array. For more information, see the Update an Email Campaign Activity topic.
You can only use segments with email campaign activities that use format_type
that is 3
, 4
, or 5
.
You can only schedule email campaign activities that have the primary_email
role and are in DRAFT
, DONE
, or ERROR
status.
DRAFT — An email campaign activity you created but have not sent to contacts. You can update email campaign activities when they are in DRAFT
status for each email campaign activity format_type
.
DONE — An email campaign activity that Constant Contact successfully sent to contacts. You can update email campaign activities when they are in DONE
status if the email campaign activity uses format_type
3.
ERROR — An email campaign activity that encountered an error.
Resend an Email Campaign Activity to New Contacts
Resend an email campaign activity by scheduling the email campaign activity when it is in DONE
status. When you schedule an email campaign activity in DONE
status, Constant Contact does not send the email campaign activity to contacts that already received it. Constant Contact only sends the email campaign activity to new contacts in the contact lists or segment you use.
Parameters
This method requires the campaign_activity_id
URL parameter. Use the campaign_activity_id
parameter to specify which email campaign activity you want to schedule.
This method also requires a request body that contains the scheduled_date
property. Use the scheduled_date
property to specify when you want Constant Contact to send the email campaign by entering an ISO-8601 format date as a string value. Use 0
as the scheduled_date
string value to have Constant Contact immediately send the email campaign activity.
This method uses dates in the ISO-8601 standard format. The full ISO-8601 format is YYYY-MM-DDThh:mm:ss.sZ
. For example, 2019-05-16T13:38:55.000Z
.
YYYY-MM-DD
refers to the year (Y), month (M), and day (D).
Thh:mm:ss.sZ
refers to the time (T) using hours (h), minutes (m), seconds (ss), fractions of a second (s), and the UTC timezone (Z).
Authorization Requirements
User privileges: campaign:send
Authorization scopes: campaign_data
Example POST Schedule Call
This example POST call schedules an email campaign activity.
POST https://api.cc.email/v3/emails/activities/{campaign_activity_id}/schedules
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/emails/activities/3cfe7b98-3633-4065-950e-de0baeb17563/schedules');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'Postman-Token' => '950246cd-0db6-4a3d-aa0d-3ac0104bddba',
'cache-control' => 'no-cache',
'Authorization' => 'Bearer {access_token}',
'Content-Type' => 'application/json'
));
$request->setBody('{
"scheduled_date": "2022-05-10T12:53:55.104Z"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"scheduled_date\": \"2022-05-10T12:53:55.104Z\"\n}");
Request request = new Request.Builder()
.url("https://api.cc.email/v3/emails/activities/3cfe7b98-3633-4065-950e-de0baeb17563/schedules")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer {access_token}")
.addHeader("cache-control", "no-cache")
.addHeader("Postman-Token", "c1902d53-2846-4174-8184-258a090f7e20")
.build();
Response response = client.newCall(request).execute();
curl -X POST \
https://api.cc.email/v3/emails/activities/3cfe7b98-3633-4065-950e-de0baeb17563/schedules \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-H 'Postman-Token: af7bc988-4c08-477e-aa2d-e885eebc2068' \
-H 'cache-control: no-cache' \
-d '{
"scheduled_date": "2022-05-10T12:53:55.104Z"
}'
Response
[
{
"scheduled_date": "2022-05-10T12:53:55.000Z"
}
]
Example Send Now Call
This example POST call immediately sends an email campaign activity.
POST https://api.cc.email/v3/emails/activities/{campaign_activity_id}/schedules
<?php
$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/emails/activities/1ead98be-dfa0-4e04-81f7-5f1534d42e9c/schedules');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'Postman-Token' => '86fd2605-74b7-4fd4-a375-d59318074166',
'cache-control' => 'no-cache',
'Authorization' => 'Bearer {access_token}',
'Content-Type' => 'application/json'
));
$request->setBody('{
"scheduled_date": "0"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"scheduled_date\": \"0\"\n}");
Request request = new Request.Builder()
.url("https://api.cc.email/v3/emails/activities/1ead98be-dfa0-4e04-81f7-5f1534d42e9c/schedules")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer {access_token}")
.addHeader("cache-control", "no-cache")
.addHeader("Postman-Token", "72dfdbe9-a7a7-4382-a4d9-37ad07a6aa5b")
.build();
Response response = client.newCall(request).execute();
curl -X POST \
https://api.cc.email/v3/emails/activities/1ead98be-dfa0-4e04-81f7-5f1534d42e9c/schedules \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-H 'Postman-Token: c7a5e652-5fb6-4475-ad0f-8363acbf5195' \
-H 'cache-control: no-cache' \
-d '{
"scheduled_date": "0"
}'
Response
[
{
"scheduled_date": "2019-05-16T13:38:55.000Z"
}
]