All URIs are relative to https://api.cc.email/v3, except if the operation defines another base path.
Method | HTTP request | Description |
---|---|---|
getContactOpenClickRate() | GET /reports/contact_reports/{contact_id}/open_and_click_rates | GET Average Open and Click Rates |
getContactTracking() | GET /reports/contact_reports/{contact_id}/activity_details | GET Contact Activity Details |
getContactTrackingCount() | GET /reports/contact_reports/{contact_id}/activity_summary | GET Contact Action Summary |
getContactOpenClickRate($contact_id, $start, $end): 'ConstantContact\Client\Model\ContactOpenAndClickRates
GET Average Open and Click Rates
Gets the average open and click rate for a given account and contact.
Looks at all tracking activities for bulk emails from a given contact over the given date range. Range cannot exceed 5 years.
Returns the rates and the number of campaign activities that were included in the calculation.
If no activities fall into the given date range, all rates will return 0 and the number of included activities will be 0.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2_access_code
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
// Configure API key authorization: api_key
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
// Configure OAuth2 access token for authorization: oauth2_implicit
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\ContactsReportingApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$contact_id = aa9ff7b0-478d-11e6-8059-00163e3c8e19; // string | The contact id which is requesting tracking activity data (e.g. aa9ff7b0-478d-11e6-8059-00163e3c8e19)
$start = 'start_example'; // string | The starting date, in ISO 8601 format, to use to get campaigns. For example: 2019-01-01T00:00:00-0500.
$end = 'end_example'; // string | The ending date, in ISO 8601 format, to use to get campaigns. For example: 2019-12-01T00:00:00-0500.
try {
$result = $apiInstance->getContactOpenClickRate($contact_id, $start, $end);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ContactsReportingApi->getContactOpenClickRate: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
contact_id | string | The contact id which is requesting tracking activity data (e.g. aa9ff7b0-478d-11e6-8059-00163e3c8e19) | |
start | string | The starting date, in ISO 8601 format, to use to get campaigns. For example: 2019-01-01T00:00:00-0500. | |
end | string | The ending date, in ISO 8601 format, to use to get campaigns. For example: 2019-12-01T00:00:00-0500. |
\OpenAPI\Client\Model\ContactOpenAndClickRates
oauth2_access_code, api_key, oauth2_implicit
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getContactTracking($contact_id, $tracking_activities_list, $tracking_activity_type, $include_campaign_activity_names, $limit): 'ConstantContact\Client\Model\ContactTrackingActivitiesPage
GET Contact Activity Details
Gets the tracking activity data for a single contact, sorted in descending activity date order.
You must chose either the `tracking_activities_list` query parameter and or the `tracking_activity_type` query parameter to specify one or more tracking activity types In the request. The `tracking_activities_list` and `tracking_activities_type` query parameters are mutually exclusive.
Valid tracking activity types | |
em_sends | Send activities |
em_opens | Email open tracking activities |
em_clicks | Link click-through tracking activities |
em_bounces | Bounce tracking activities |
em_optouts | Opt-out tracking activities |
em_forwards | Forward to a friend tracking activities |
p_contact_open | Landing page opens |
p_contact_click | Landing page clicks |
p_contact_add | Landing page adds |
p_contact_update | Landing page updates |
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2_access_code
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
// Configure API key authorization: api_key
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
// Configure OAuth2 access token for authorization: oauth2_implicit
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\ContactsReportingApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$contact_id = aa9ff7b0-478d-11e6-8059-00163e3c8e19; // string | The contact's ID for which tracking activity data is requested.
$tracking_activities_list = em_clicks,em_opens; // string | Specify one or more tracking activity types to include as a comma-delimited string. The `tracking_activities_list` and `tracking_activities_type` query parameters are mutually exclusive.
$tracking_activity_type = `tracking_activity_type=em_sends&tracking_activity_type=em_opens`; // string[] | Specify one or more tracking activity types to include as an array. The `tracking_activities_list` and `tracking_activities_type` query parameters are mutually exclusive.
$include_campaign_activity_names = true; // bool | Default (`true`) returns campaign activity names in the results. Not including campaign activity names in the results (`false`), is more efficient.
$limit = 20; // string | The number of tracking activities to return in a single page. Valid values are 1 to 100. Default is 100.
try {
$result = $apiInstance->getContactTracking($contact_id, $tracking_activities_list, $tracking_activity_type, $include_campaign_activity_names, $limit);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ContactsReportingApi->getContactTracking: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
contact_id | string | The contact's ID for which tracking activity data is requested. | |
tracking_activities_list | string | Specify one or more tracking activity types to include as a comma-delimited string. The `tracking_activities_list` and `tracking_activities_type` query parameters are mutually exclusive. | [optional] |
tracking_activity_type | string[] | Specify one or more tracking activity types to include as an array. The `tracking_activities_list` and `tracking_activities_type` query parameters are mutually exclusive. | [optional] |
include_campaign_activity_names | bool | Default (`true`) returns campaign activity names in the results. Not including campaign activity names in the results (`false`), is more efficient. | [optional] [default to true] |
limit | string | The number of tracking activities to return in a single page. Valid values are 1 to 100. Default is 100. | [optional] [default to '100'] |
\OpenAPI\Client\Model\ContactTrackingActivitiesPage
oauth2_access_code, api_key, oauth2_implicit
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getContactTrackingCount($contact_id, $start, $end): 'ConstantContact\Client\Model\ContactCampaignActivitiesSummary
GET Contact Action Summary
Get a list of the recent emails (aka, campaign activities) sent to a specific contact and a summary of the actions the contact took on that email for the most recent 200 campaigns.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2_access_code
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
// Configure API key authorization: api_key
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
// Configure OAuth2 access token for authorization: oauth2_implicit
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\ContactsReportingApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$contact_id = aa9ff7b0-478d-11e6-8059-00163e3c8e19; // string | The contact id which is requesting tracking activity data (e.g. aa9ff7b0-478d-11e6-8059-00163e3c8e19)
$start = 'start_example'; // string | The starting date, in ISO 8601 format, to use to get campaigns. For example: 2019-01-01T00:00:00-0500.
$end = 'end_example'; // string | The ending date, in ISO 8601 format, to use to get campaigns. For example: 2019-12-01T00:00:00-0500.
try {
$result = $apiInstance->getContactTrackingCount($contact_id, $start, $end);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ContactsReportingApi->getContactTrackingCount: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
contact_id | string | The contact id which is requesting tracking activity data (e.g. aa9ff7b0-478d-11e6-8059-00163e3c8e19) | |
start | string | The starting date, in ISO 8601 format, to use to get campaigns. For example: 2019-01-01T00:00:00-0500. | |
end | string | The ending date, in ISO 8601 format, to use to get campaigns. For example: 2019-12-01T00:00:00-0500. |
\OpenAPI\Client\Model\ContactCampaignActivitiesSummary
oauth2_access_code, api_key, oauth2_implicit
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]