To delete an A/B test for a primary campaign activity make a DELETE
call to emails/activities/{campaign_activity_id}/abtest
. Deleting an A/B test returns the type
back to NEWSLETTER
and the type_code
back to 10
. You can only delete A/B tests that have a current_status
of DRAFT
. After an A/B test is deleted, when sending the email campaign activity Constant Contact uses the original subject line rather than the alternate A/B test subject line.
Authorization Requirements
User privileges: campaign:write
Authorization scopes: campaign_data
Parameters
Use the campaign_activity_id
URL parameter to delete an A/B test for a primary email campaign activity that has a current_status
of DRAFT
. For example: emails/activities/{campaign_activity_id}/abtest
.
Example DELETE Email Campaign Activity A/B Test
DELETE https://api.cc.email/v3/emails/activities/{campaign_activity_id}/abtest
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.cc.email/v3/emails/activities/b6d041e2-8450-409a-acfb-e858c260f4f6/abtest',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Content-Type: application/json',
'Authorization: Bearer {access_token}'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.cc.email/v3/emails/activities/b6d041e2-8450-409a-acfb-e858c260f4f6/abtest")
.method("DELETE", body)
.addHeader("Accept", "application/json")
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer {access_token}")
.build();
Response response = client.newCall(request).execute();
curl --location --request DELETE 'https://api.cc.email/v3/emails/activities/b6d041e2-8450-409a-acfb-e858c260f4f6/abtest' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access_token}'
Response
A successful DELETE call returns a 204 response code and an empty response body.