Delete multiple contact lists.

To create an asynchronous job that deletes up to 100 contact lists from an account, make a POST call to the /activities/list_delete endpoint and in the request body, specify the contact lists (list_ids) to delete.

Example Requests

POST /activities/list_delete

Endpoint Requirements

User privileges: contacts:write

Authorization scopes: contact_data

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.cc.email/v3/activities/list_delete',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'	
{
  "list_ids": [
    "08936f78-662a-11eb-af0a-fa163e56c9b0","205947ac-3f74-11ed-a450-074013d9081f"
  ]
}',
  CURLOPT_HTTPHEADER => array(
    'Accept: */*',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

curl --location --request POST 'https://api.cc.email/v3/activities/list_delete \
 --header 'Accept: */*' \
--header 'Content-Type: application/json' \
--data-raw '	
{
  "list_ids": [
    "08936f78-662a-11eb-af0a-fa163e56c9b0","205947ac-3f74-11ed-a450-074013d9081f"
  ]
}'
OkHttpClient client=new OkHttpClient().newBuilder()
        .build();
        MediaType mediaType=MediaType.parse("application/json");
        RequestBody body=RequestBody.create(mediaType,"\t\n{\n  \"list_ids\": [\n    \"08936f78-662a-11eb-af0a-fa163e56c9b0\",\"205947ac-3f74-11ed-a450-074013d9081f\"\n  ]\n}");
        Request request=new Request.Builder()
        .url("https://api.cc.email/v3/activities/list_delete")
        .method("POST",body)
        .addHeader("Accept","*/*")
        .addHeader("Content-Type","application/json")
        .build();
        Response response=client.newCall(request).execute();

Example Response

{
  "activity_id": "0c2712b8-9700-11eb-a392-33d450967a54",
  "state": "initialized",
  "started_at": "completed",
  "completed_at": "2016-01-23T13:48:44.108Z",
  "created_at": "2016-01-23T13:48:44.108Z",
  "updated_at": "2016-01-23T13:48:44.108Z",
  "percent_done": 75,
  "activity_errors": [
    "Message describing the error condition."
  ],
  "status": {
    "list_count": 3
  },
  "_links": {
    "self": {
      "href": "/v3/activities/{activity_id}"
    }
  }
}

Checking the Activity Status for Job Complete

Check the activity status and when Constant Contact has completed processing an activity by making a GET call to /activities/{activity_id} using the activity_id located in the _links section of the response.

GET https://api.cc.email/v3/activities/{activity_id}

Endpoint Requirements

User privileges: contacts:write

Authorization scopes: contact_data

Try it!