Make a GET call to the /contact_lists/{list_id}
endpoint to get details about a specific contact list (list_id
). To
return the total number of all or active contact members on a list, set the include_membership_count
query parameter
to either all
or active
. Use all
to include all contacts. Use active
to limit the total count to
include only active contacts (mailable contacts).
Example Request
This example request uses the include_membership_count
query parameters.
GET https://api.cc.email/v3/contact_lists/{list_id}?&include_membership_count=active
Endpoint Requirements
User privileges: contacts:read
Authorization scopes: contact_data
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/contact_lists/123a3f10-01ab-11e6-8106-00163e6dbd8c?include_membership_count=active")
.method("GET",body)
.addHeader("Accept","*/*")
.addHeader("Content-Type","application/json")
.addHeader("Authorization","Bearer {access_token}")
.build();
Response response=client.newCall(request).execute();
curl --location --request GET https://api.cc.email/v3/contact_lists/123a3f10-01ab-11e6-8106-00163e6dbd8c?include_membership_count=active' \
--header 'Accept: */*' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access_token}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.cc.email/v3/contact_lists/123a3f10-01ab-11e6-8106-00163e6dbd8c?include_membership_count=active',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: */*',
'Content-Type: application/json',
'Authorization: Bearer {access_token}'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Example Response
{
"list_id": "123a3f10-01ab-11e6-8106-00163e6dbd8c",
"name": "Tier3",
"created_at": "2016-04-13T19:08:16Z",
"updated_at": "2016-04-13T19:08:16Z",
"favorite": false,
"membership_count": 25
}
Response details include the following:
-
list_id
: The list’s unique ID. -
name
: The name of the contact list. -
created_at
: The system generated date and time that the resource was created, in ISO-8601 format. -
updated_at
: The system generated date and time that the resource was last updated, in ISO-8601 format. -
favorite
: Identifies whether or not the contact list was favorited. To favorite a list, make the PUT call to the/contact_lists/{list_id}
endpoint and in the request body, setfavorite
totrue
. -
membership_count
: Includes the total contact membership count for the list.
What’s Next
If you want to get contact details for a particular list, make a GET call to the /contacts?lists={list_id1},{list_id2}
endpoint. Use the lists
query parameter to specify which lists to use. The response includes contact details, such as contact_id
,first_name
, last_name
, job_title
, and more. Try it!
Constant Contact does not sell or rent email addresses. Users are not permitted to upload or use purchased, traded, shared, or borrowed lists to their Constant Contact account.
Review our permission policy for more information.