Skip to content

Latest commit

 

History

History
244 lines (175 loc) · 12.1 KB

ContactsReportingApi.md

File metadata and controls

244 lines (175 loc) · 12.1 KB

ConstantContactClient::ContactsReportingApi

All URIs are relative to https://api.cc.email/v3

Method HTTP request Description
get_contact_open_click_rate_report GET /reports/contact_reports/{contact_id}/open_and_click_rates GET Average Open and Click Rates
get_contact_tracking_count_report GET /reports/contact_reports/{contact_id}/activity_summary GET Contact Action Summary
get_contact_tracking_report GET /reports/contact_reports/{contact_id}/activity_details GET Contact Activity Details

get_contact_open_click_rate_report

get_contact_open_click_rate_report(contact_id, start, _end)

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.

Examples

require 'time'
require 'constant_contact_client'
# setup authorization
ConstantContactClient.configure do |config|
  # Configure OAuth2 access token for authorization: oauth2_access_code
  config.access_token = 'YOUR ACCESS TOKEN'

  # Configure OAuth2 access token for authorization: oauth2_implicit
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ConstantContactClient::ContactsReportingApi.new
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.

begin
  # GET Average Open and Click Rates
  result = api_instance.get_contact_open_click_rate_report(contact_id, start, _end)
  p result
rescue ConstantContactClient::ApiError => e
  puts "Error when calling ContactsReportingApi->get_contact_open_click_rate_report: #{e}"
end

Using the get_contact_open_click_rate_report_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_contact_open_click_rate_report_with_http_info(contact_id, start, _end)

begin
  # GET Average Open and Click Rates
  data, status_code, headers = api_instance.get_contact_open_click_rate_report_with_http_info(contact_id, start, _end)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetContactOpenClickRateReport200Response>
rescue ConstantContactClient::ApiError => e
  puts "Error when calling ContactsReportingApi->get_contact_open_click_rate_report_with_http_info: #{e}"
end

Parameters

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.

Return type

GetContactOpenClickRateReport200Response

Authorization

oauth2_access_code, oauth2_implicit

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_contact_tracking_count_report

get_contact_tracking_count_report(contact_id, start, _end)

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.

Examples

require 'time'
require 'constant_contact_client'
# setup authorization
ConstantContactClient.configure do |config|
  # Configure OAuth2 access token for authorization: oauth2_access_code
  config.access_token = 'YOUR ACCESS TOKEN'

  # Configure OAuth2 access token for authorization: oauth2_implicit
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ConstantContactClient::ContactsReportingApi.new
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.

begin
  # GET Contact Action Summary
  result = api_instance.get_contact_tracking_count_report(contact_id, start, _end)
  p result
rescue ConstantContactClient::ApiError => e
  puts "Error when calling ContactsReportingApi->get_contact_tracking_count_report: #{e}"
end

Using the get_contact_tracking_count_report_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_contact_tracking_count_report_with_http_info(contact_id, start, _end)

begin
  # GET Contact Action Summary
  data, status_code, headers = api_instance.get_contact_tracking_count_report_with_http_info(contact_id, start, _end)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetContactTrackingCountReport200Response>
rescue ConstantContactClient::ApiError => e
  puts "Error when calling ContactsReportingApi->get_contact_tracking_count_report_with_http_info: #{e}"
end

Parameters

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.

Return type

GetContactTrackingCountReport200Response

Authorization

oauth2_access_code, oauth2_implicit

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_contact_tracking_report

get_contact_tracking_report(contact_id, opts)

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_sendsSend activities
em_opensEmail open tracking activities
em_clicksLink click-through tracking activities
em_bouncesBounce tracking activities
em_optoutsOpt-out tracking activities
em_forwardsForward to a friend tracking activities
p_contact_openLanding page opens
p_contact_clickLanding page clicks
p_contact_addLanding page adds
p_contact_update Landing page updates

Examples

require 'time'
require 'constant_contact_client'
# setup authorization
ConstantContactClient.configure do |config|
  # Configure OAuth2 access token for authorization: oauth2_access_code
  config.access_token = 'YOUR ACCESS TOKEN'

  # Configure OAuth2 access token for authorization: oauth2_implicit
  config.access_token = 'YOUR ACCESS TOKEN'
end

api_instance = ConstantContactClient::ContactsReportingApi.new
contact_id = 'aa9ff7b0-478d-11e6-8059-00163e3c8e19' # String | The contact's ID for which tracking activity data is requested.
opts = {
  tracking_activities_list: ['em_sends'], # Array<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: ['inner_example'], # Array<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, # Boolean | 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.
}

begin
  # GET Contact Activity Details
  result = api_instance.get_contact_tracking_report(contact_id, opts)
  p result
rescue ConstantContactClient::ApiError => e
  puts "Error when calling ContactsReportingApi->get_contact_tracking_report: #{e}"
end

Using the get_contact_tracking_report_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_contact_tracking_report_with_http_info(contact_id, opts)

begin
  # GET Contact Activity Details
  data, status_code, headers = api_instance.get_contact_tracking_report_with_http_info(contact_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetContactTrackingReport200Response>
rescue ConstantContactClient::ApiError => e
  puts "Error when calling ContactsReportingApi->get_contact_tracking_report_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
contact_id String The contact's ID for which tracking activity data is requested.
tracking_activities_list Array<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 Array<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 Boolean 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']

Return type

GetContactTrackingReport200Response

Authorization

oauth2_access_code, oauth2_implicit

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json