Class: ConstantContactClient::ContactsReportingApi
- Inherits:
-
Object
- Object
- ConstantContactClient::ContactsReportingApi
- Defined in:
- lib/constant_contact_client/api/contacts_reporting_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_contact_open_click_rate_report(contact_id, start, _end, opts = {}) ⇒ GetContactOpenClickRateReport200Response
GET Average Open and Click Rates <p>Gets the average open and click rate for a given account and contact.<p>Looks at all tracking activities for bulk emails from a given contact over the given date range.
-
#get_contact_open_click_rate_report_with_http_info(contact_id, start, _end, opts = {}) ⇒ Array<(GetContactOpenClickRateReport200Response, Integer, Hash)>
GET Average Open and Click Rates <p>Gets the average open and click rate for a given account and contact.<p>Looks at all tracking activities for bulk emails from a given contact over the given date range.
-
#get_contact_tracking_count_report(contact_id, start, _end, opts = {}) ⇒ GetContactTrackingCountReport200Response
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.
-
#get_contact_tracking_count_report_with_http_info(contact_id, start, _end, opts = {}) ⇒ Array<(GetContactTrackingCountReport200Response, Integer, Hash)>
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.
-
#get_contact_tracking_report(contact_id, opts = {}) ⇒ GetContactTrackingReport200Response
GET Contact Activity Details <p>Gets the tracking activity data for a single contact, sorted in descending activity date order.</p> <p>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.
-
#get_contact_tracking_report_with_http_info(contact_id, opts = {}) ⇒ Array<(GetContactTrackingReport200Response, Integer, Hash)>
GET Contact Activity Details <p>Gets the tracking activity data for a single contact, sorted in descending activity date order.</p> <p>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.
-
#initialize(api_client = ApiClient.default) ⇒ ContactsReportingApi
constructor
A new instance of ContactsReportingApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ContactsReportingApi
Returns a new instance of ContactsReportingApi.
19 20 21 |
# File 'lib/constant_contact_client/api/contacts_reporting_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/constant_contact_client/api/contacts_reporting_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_contact_open_click_rate_report(contact_id, start, _end, opts = {}) ⇒ GetContactOpenClickRateReport200Response
GET Average Open and Click Rates <p>Gets the average open and click rate for a given account and contact.<p>Looks at all tracking activities for bulk emails from a given contact over the given date range. Range cannot exceed 5 years.</p><p>Returns the rates and the number of campaign activities that were included in the calculation.</p><p>If no activities fall into the given date range, all rates will return 0 and the number of included activities will be 0.</p>
29 30 31 32 |
# File 'lib/constant_contact_client/api/contacts_reporting_api.rb', line 29 def get_contact_open_click_rate_report(contact_id, start, _end, opts = {}) data, _status_code, _headers = get_contact_open_click_rate_report_with_http_info(contact_id, start, _end, opts) data end |
#get_contact_open_click_rate_report_with_http_info(contact_id, start, _end, opts = {}) ⇒ Array<(GetContactOpenClickRateReport200Response, Integer, Hash)>
GET Average Open and Click Rates <p>Gets the average open and click rate for a given account and contact.<p>Looks at all tracking activities for bulk emails from a given contact over the given date range. Range cannot exceed 5 years.</p><p>Returns the rates and the number of campaign activities that were included in the calculation.</p><p>If no activities fall into the given date range, all rates will return 0 and the number of included activities will be 0.</p>
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/constant_contact_client/api/contacts_reporting_api.rb', line 41 def get_contact_open_click_rate_report_with_http_info(contact_id, start, _end, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsReportingApi.get_contact_open_click_rate_report ...' end # verify the required parameter 'contact_id' is set if @api_client.config.client_side_validation && contact_id.nil? fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactsReportingApi.get_contact_open_click_rate_report" end # verify the required parameter 'start' is set if @api_client.config.client_side_validation && start.nil? fail ArgumentError, "Missing the required parameter 'start' when calling ContactsReportingApi.get_contact_open_click_rate_report" end # verify the required parameter '_end' is set if @api_client.config.client_side_validation && _end.nil? fail ArgumentError, "Missing the required parameter '_end' when calling ContactsReportingApi.get_contact_open_click_rate_report" end # resource path local_var_path = '/reports/contact_reports/{contact_id}/open_and_click_rates'.sub('{' + 'contact_id' + '}', CGI.escape(contact_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'start'] = start query_params[:'end'] = _end # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetContactOpenClickRateReport200Response' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2_access_code', 'oauth2_implicit'] = opts.merge( :operation => :"ContactsReportingApi.get_contact_open_click_rate_report", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsReportingApi#get_contact_open_click_rate_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_contact_tracking_count_report(contact_id, start, _end, opts = {}) ⇒ GetContactTrackingCountReport200Response
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.
106 107 108 109 |
# File 'lib/constant_contact_client/api/contacts_reporting_api.rb', line 106 def get_contact_tracking_count_report(contact_id, start, _end, opts = {}) data, _status_code, _headers = get_contact_tracking_count_report_with_http_info(contact_id, start, _end, opts) data end |
#get_contact_tracking_count_report_with_http_info(contact_id, start, _end, opts = {}) ⇒ Array<(GetContactTrackingCountReport200Response, Integer, Hash)>
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.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/constant_contact_client/api/contacts_reporting_api.rb', line 118 def get_contact_tracking_count_report_with_http_info(contact_id, start, _end, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsReportingApi.get_contact_tracking_count_report ...' end # verify the required parameter 'contact_id' is set if @api_client.config.client_side_validation && contact_id.nil? fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactsReportingApi.get_contact_tracking_count_report" end # verify the required parameter 'start' is set if @api_client.config.client_side_validation && start.nil? fail ArgumentError, "Missing the required parameter 'start' when calling ContactsReportingApi.get_contact_tracking_count_report" end # verify the required parameter '_end' is set if @api_client.config.client_side_validation && _end.nil? fail ArgumentError, "Missing the required parameter '_end' when calling ContactsReportingApi.get_contact_tracking_count_report" end # resource path local_var_path = '/reports/contact_reports/{contact_id}/activity_summary'.sub('{' + 'contact_id' + '}', CGI.escape(contact_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'start'] = start query_params[:'end'] = _end # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetContactTrackingCountReport200Response' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2_access_code', 'oauth2_implicit'] = opts.merge( :operation => :"ContactsReportingApi.get_contact_tracking_count_report", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsReportingApi#get_contact_tracking_count_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_contact_tracking_report(contact_id, opts = {}) ⇒ GetContactTrackingReport200Response
GET Contact Activity Details <p>Gets the tracking activity data for a single contact, sorted in descending activity date order.</p> <p>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.</p> <table><tr><td colspan=’2’>Valid tracking activity types</td></tr> <tr><td>em_sends</td><td>Send activities</td></tr> <tr><td>em_opens</td><td>Email open tracking activities</td></tr> <tr><td>em_clicks</td><td>Link click-through tracking activities</td></tr> <tr><td>em_bounces</td><td>Bounce tracking activities</td></tr> <tr><td>em_optouts</td><td>Opt-out tracking activities</td></tr><tr> <td>em_forwards</td><td>Forward to a friend tracking activities</td></tr> <tr><td>p_contact_open</td><td>Landing page opens</td></tr> <tr><td>p_contact_click</td><td>Landing page clicks</td></tr> <tr><td>p_contact_add</td><td>Landing page adds</td></tr> <tr><td>p_contact_update </td><td> Landing page updates</td></tr> </table>
185 186 187 188 |
# File 'lib/constant_contact_client/api/contacts_reporting_api.rb', line 185 def get_contact_tracking_report(contact_id, opts = {}) data, _status_code, _headers = get_contact_tracking_report_with_http_info(contact_id, opts) data end |
#get_contact_tracking_report_with_http_info(contact_id, opts = {}) ⇒ Array<(GetContactTrackingReport200Response, Integer, Hash)>
GET Contact Activity Details <p>Gets the tracking activity data for a single contact, sorted in descending activity date order.</p> <p>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.</p> <table><tr><td colspan='2'>Valid tracking activity types</td></tr> <tr><td><b>em_sends</b></td><td>Send activities</td></tr> <tr><td><b>em_opens</b></td><td>Email open tracking activities</td></tr> <tr><td><b>em_clicks</b></td><td>Link click-through tracking activities</td></tr> <tr><td><b>em_bounces</b></td><td>Bounce tracking activities</td></tr> <tr><td><b>em_optouts</b></td><td>Opt-out tracking activities</td></tr><tr> <td><b>em_forwards</b></td><td>Forward to a friend tracking activities</td></tr> <tr><td><b>p_contact_open</b></td><td>Landing page opens</td></tr> <tr><td><b>p_contact_click</b></td><td>Landing page clicks</td></tr> <tr><td><b>p_contact_add</b></td><td>Landing page adds</td></tr> <tr><td><b>p_contact_update </b></td><td> Landing page updates</td></tr> </table>
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/constant_contact_client/api/contacts_reporting_api.rb', line 199 def get_contact_tracking_report_with_http_info(contact_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsReportingApi.get_contact_tracking_report ...' end # verify the required parameter 'contact_id' is set if @api_client.config.client_side_validation && contact_id.nil? fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactsReportingApi.get_contact_tracking_report" end allowable_values = ["em_sends", "em_opens", "em_clicks", "em_bounces", "em_optouts", "em_forwards", "p_contact_open", "p_contact_click", "p_contact_add", "p_contact_update"] if @api_client.config.client_side_validation && opts[:'tracking_activities_list'] && !opts[:'tracking_activities_list'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"tracking_activities_list\", must include one of #{allowable_values}" end # resource path local_var_path = '/reports/contact_reports/{contact_id}/activity_details'.sub('{' + 'contact_id' + '}', CGI.escape(contact_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'tracking_activities_list'] = @api_client.build_collection_param(opts[:'tracking_activities_list'], :multi) if !opts[:'tracking_activities_list'].nil? query_params[:'tracking_activity_type'] = @api_client.build_collection_param(opts[:'tracking_activity_type'], :csv) if !opts[:'tracking_activity_type'].nil? query_params[:'include_campaign_activity_names'] = opts[:'include_campaign_activity_names'] if !opts[:'include_campaign_activity_names'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetContactTrackingReport200Response' # auth_names auth_names = opts[:debug_auth_names] || ['oauth2_access_code', 'oauth2_implicit'] = opts.merge( :operation => :"ContactsReportingApi.get_contact_tracking_report", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsReportingApi#get_contact_tracking_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |