Get details about a specific contact.
To get details about a specific contact (contact_id
), make a GET call to the /contacts/{contact_id}
endpoint.
Use the include
parameter to get any subresources you want returned in the results. Use a comma if you want to separate multiple sub-resources. Valid values: custom_fields
, list_memberships
, taggings
, notes
, phone_numbers
, street_addresses
.
Learn more about contact resource and subresources.
Request Example
GET https://api.cc.email/v3/contacts/{contact_id}
Endpoint Requirements
User privileges: contacts:read
Authorization scopes: contact_data
The following request uses the include
parameter to return a contacts taggings
, notes
, and list memberships
details.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.cc.email/v3/contacts/{contact_id}?include=list_memberships%2Ctaggings%2Cnotes',
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;
curl --location 'https://api.cc.email/v3/contacts/{contacts_id}?include=list_memberships%2Ctaggings%2Cnotes' \
--header 'Accept: */*' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access token}'
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/contacts/{contact_id}?include=taggings%2Cnotes%2Clist_memberships")
.method("GET", body)
.addHeader("Accept", "*/*")
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer {access token}")
.build();
Response response = client.newCall(request).execute();
Response Body Example
{
"contact_id": "1898ae62-4752-11e9-9c8a-fa163e6b01c1",
"email_address": {
"address": "dlang@example.com",
"permission_to_send": "implicit",
"created_at": "2016-03-03T10:53:04-05:00",
"updated_at": "2016-03-03T10:56:29-05:00",
"opt_in_source": "Contact",
"opt_in_date": "2016-01-23T13:48:44.108Z",
"opt_out_source": "Contact",
"opt_out_date": "2016-01-23T13:48:44.108Z",
"opt_out_reason": "I am no longer interested in this service.",
"confirm_status": "confirmed"
},
"first_name": "Debora",
"last_name": "Lang",
"job_title": "Musician",
"company_name": "Acme Corp.",
"birthday_month": 11,
"birthday_day": 24,
"anniversary": "2006-11-15",
"update_source": "Contact",
"create_source": "Account",
"created_at": "2016-01-23T13:48:44.108Z",
"updated_at": "2016-01-23T13:48:44.108Z",
"deleted_at": "2016-07-08",
],
"list_memberships": [
"07936f78-662a-11eb-af0a-fa163e56c9b0"
],
"taggings": [
"e7ddac60-51da-11eb-b3a4-fa163e6b01d5"
],
"notes": [
{
"note_id": "3fa85f64-5717-4562-b3fc-2c963f66afd5",
"created_at": "2021-05-12T13:48:44.108Z",
"content": "This contact resubscribed on 2021-05-12."
}
],
"sms_channel": {
"sms_channel_id": "3fa85f64-5712-6245-b3fc-2c963f66bfc7",
"sms_address": "7815551212",
"dial_code": "1",
"country_code": "US",
"update_source": "Contact",
"create_source": "Account",
"sms_channel_consents": [
{
"sms_consent_permission": "explicit",
"consent_type": "promotional_sms",
"opt_in_date": "2016-01-23T13:48:44.108Z",
"opt_out_date": "",
"advertised_frequency": "1",
"advertised_interval": "monthly",
"created_at": "2016-01-23T13:48:44.108Z",
"updated_at": "2023-01-23T13:48:44.108Z"
}
]
}
}
Try it! in the API Reference