=begin #Mailchimp Marketing API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 3.0.5 Contact: apihelp@mailchimp.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.12 =end require 'uri' module MailchimpMarketing class ReportsApi attr_accessor :api_client def initialize(api_client) @api_client = api_client end # List campaign reports # Get campaign reports. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** (default to 10) # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. (default to 0) # @option opts [String] :type The campaign type. # @option opts [DateTime] :before_send_time Restrict the response to campaigns sent before the set time. We recommend [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00. # @option opts [DateTime] :since_send_time Restrict the response to campaigns sent after the set time. We recommend [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00. # @return [CampaignReports1] def get_all_campaign_reports(opts = {}) data, _status_code, _headers = get_all_campaign_reports_with_http_info(opts) data end # List campaign reports # Get campaign reports. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. # @option opts [String] :type The campaign type. # @option opts [DateTime] :before_send_time Restrict the response to campaigns sent before the set time. We recommend [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00. # @option opts [DateTime] :since_send_time Restrict the response to campaigns sent after the set time. We recommend [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00. # @return [Array<(CampaignReports1, Fixnum, Hash)>] CampaignReports1 data, response status code and response headers def get_all_campaign_reports_with_http_info(opts = {}) # resource path local_var_path = '/reports' # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'before_send_time'] = opts[:'before_send_time'] if !opts[:'before_send_time'].nil? query_params[:'since_send_time'] = opts[:'since_send_time'] if !opts[:'since_send_time'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CampaignReports1') return data, status_code, headers end # Get campaign report # Get report details for a specific sent campaign. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [CampaignReport] def get_campaign_report(campaign_id = {}, opts = {}) data, _status_code, _headers = get_campaign_report_with_http_info(campaign_id, opts) data end # Get campaign report # Get report details for a specific sent campaign. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [Array<(CampaignReport, Fixnum, Hash)>] CampaignReport data, response status code and response headers def get_campaign_report_with_http_info(campaign_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CampaignReport') return data, status_code, headers end # List abuse reports # Get a list of abuse complaints for a specific campaign. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [AbuseComplaints1] def get_campaign_abuse_reports(campaign_id = {}, opts = {}) data, _status_code, _headers = get_campaign_abuse_reports_with_http_info(campaign_id, opts) data end # List abuse reports # Get a list of abuse complaints for a specific campaign. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [Array<(AbuseComplaints1, Fixnum, Hash)>] AbuseComplaints1 data, response status code and response headers def get_campaign_abuse_reports_with_http_info(campaign_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/abuse-reports'.sub('{' + 'campaign_id' + '}', campaign_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'AbuseComplaints1') return data, status_code, headers end # Get abuse report # Get information about a specific abuse report for a campaign. # @param campaign_id The unique id for the campaign. # @param report_id The id for the abuse report. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [AbuseComplaint1] def get_campaign_abuse_report(campaign_id = {}, report_id = {}, opts = {}) data, _status_code, _headers = get_campaign_abuse_report_with_http_info(campaign_id, report_id, opts) data end # Get abuse report # Get information about a specific abuse report for a campaign. # @param campaign_id The unique id for the campaign. # @param report_id The id for the abuse report. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [Array<(AbuseComplaint1, Fixnum, Hash)>] AbuseComplaint1 data, response status code and response headers def get_campaign_abuse_report_with_http_info(campaign_id, report_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/abuse-reports/{report_id}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s).sub('{' + 'report_id' + '}', report_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'AbuseComplaint1') return data, status_code, headers end # List campaign feedback # Get feedback based on a campaign's statistics. Advice feedback is based on campaign stats like opens, clicks, unsubscribes, bounces, and more. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [CampaignAdviceReport] def get_campaign_advice(campaign_id = {}, opts = {}) data, _status_code, _headers = get_campaign_advice_with_http_info(campaign_id, opts) data end # List campaign feedback # Get feedback based on a campaign's statistics. Advice feedback is based on campaign stats like opens, clicks, unsubscribes, bounces, and more. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [Array<(CampaignAdviceReport, Fixnum, Hash)>] CampaignAdviceReport data, response status code and response headers def get_campaign_advice_with_http_info(campaign_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/advice'.sub('{' + 'campaign_id' + '}', campaign_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CampaignAdviceReport') return data, status_code, headers end # List campaign details # Get information about clicks on specific links in your Mailchimp campaigns. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** (default to 10) # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. (default to 0) # @return [ClickDetailReport] def get_campaign_click_details(campaign_id = {}, opts = {}) data, _status_code, _headers = get_campaign_click_details_with_http_info(campaign_id, opts) data end # List campaign details # Get information about clicks on specific links in your Mailchimp campaigns. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. # @return [Array<(ClickDetailReport, Fixnum, Hash)>] ClickDetailReport data, response status code and response headers def get_campaign_click_details_with_http_info(campaign_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/click-details'.sub('{' + 'campaign_id' + '}', campaign_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ClickDetailReport') return data, status_code, headers end # Get campaign link details # Get click details for a specific link in a campaign. # @param campaign_id The unique id for the campaign. # @param link_id The id for the link. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [ClickDetailReport] def get_campaign_click_details_for_link(campaign_id = {}, link_id = {}, opts = {}) data, _status_code, _headers = get_campaign_click_details_for_link_with_http_info(campaign_id, link_id, opts) data end # Get campaign link details # Get click details for a specific link in a campaign. # @param campaign_id The unique id for the campaign. # @param link_id The id for the link. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [Array<(ClickDetailReport, Fixnum, Hash)>] ClickDetailReport data, response status code and response headers def get_campaign_click_details_for_link_with_http_info(campaign_id, link_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/click-details/{link_id}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s).sub('{' + 'link_id' + '}', link_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ClickDetailReport') return data, status_code, headers end # List clicked link subscribers # Get information about list members who clicked on a specific link in a campaign. # @param campaign_id The unique id for the campaign. # @param link_id The id for the link. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** (default to 10) # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. (default to 0) # @return [ClickDetailMembers] def get_subscribers_info(campaign_id = {}, link_id = {}, opts = {}) data, _status_code, _headers = get_subscribers_info_with_http_info(campaign_id, link_id, opts) data end # List clicked link subscribers # Get information about list members who clicked on a specific link in a campaign. # @param campaign_id The unique id for the campaign. # @param link_id The id for the link. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. # @return [Array<(ClickDetailMembers, Fixnum, Hash)>] ClickDetailMembers data, response status code and response headers def get_subscribers_info_with_http_info(campaign_id, link_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/click-details/{link_id}/members'.sub('{' + 'campaign_id' + '}', campaign_id.to_s).sub('{' + 'link_id' + '}', link_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ClickDetailMembers') return data, status_code, headers end # Get clicked link subscriber # Get information about a specific subscriber who clicked a link in a specific campaign. # @param campaign_id The unique id for the campaign. # @param link_id The id for the link. # @param subscriber_hash The MD5 hash of the lowercase version of the list member's email address. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [ClickDetailMember] def get_subscriber_info(campaign_id = {}, link_id = {}, subscriber_hash = {}, opts = {}) data, _status_code, _headers = get_subscriber_info_with_http_info(campaign_id, link_id, subscriber_hash, opts) data end # Get clicked link subscriber # Get information about a specific subscriber who clicked a link in a specific campaign. # @param campaign_id The unique id for the campaign. # @param link_id The id for the link. # @param subscriber_hash The MD5 hash of the lowercase version of the list member's email address. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [Array<(ClickDetailMember, Fixnum, Hash)>] ClickDetailMember data, response status code and response headers def get_subscriber_info_with_http_info(campaign_id, link_id, subscriber_hash, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/click-details/{link_id}/members/{subscriber_hash}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s).sub('{' + 'link_id' + '}', link_id.to_s).sub('{' + 'subscriber_hash' + '}', subscriber_hash.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ClickDetailMember') return data, status_code, headers end # List domain performance stats # Get statistics for the top-performing email domains in a campaign. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [DomainPerformance] def get_domain_performance_for_campaign(campaign_id = {}, opts = {}) data, _status_code, _headers = get_domain_performance_for_campaign_with_http_info(campaign_id, opts) data end # List domain performance stats # Get statistics for the top-performing email domains in a campaign. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [Array<(DomainPerformance, Fixnum, Hash)>] DomainPerformance data, response status code and response headers def get_domain_performance_for_campaign_with_http_info(campaign_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/domain-performance'.sub('{' + 'campaign_id' + '}', campaign_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DomainPerformance') return data, status_code, headers end # List campaign product activity # Get breakdown of product activity for a campaign # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** (default to 10) # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. (default to 0) # @option opts [String] :sort_field Returns files sorted by the specified field. # @return [InlineResponse2008] def get_ecommerce_product_activity_for_campaign(campaign_id = {}, opts = {}) data, _status_code, _headers = get_ecommerce_product_activity_for_campaign_with_http_info(campaign_id, opts) data end # List campaign product activity # Get breakdown of product activity for a campaign # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. # @option opts [String] :sort_field Returns files sorted by the specified field. # @return [Array<(InlineResponse2008, Fixnum, Hash)>] InlineResponse2008 data, response status code and response headers def get_ecommerce_product_activity_for_campaign_with_http_info(campaign_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/ecommerce-product-activity'.sub('{' + 'campaign_id' + '}', campaign_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'sort_field'] = opts[:'sort_field'] if !opts[:'sort_field'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'InlineResponse2008') return data, status_code, headers end # List eep url activity # Get a summary of social activity for the campaign, tracked by EepURL. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [EepurlActivity] def get_eepurl_activity_for_campaign(campaign_id = {}, opts = {}) data, _status_code, _headers = get_eepurl_activity_for_campaign_with_http_info(campaign_id, opts) data end # List eep url activity # Get a summary of social activity for the campaign, tracked by EepURL. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [Array<(EepurlActivity, Fixnum, Hash)>] EepurlActivity data, response status code and response headers def get_eepurl_activity_for_campaign_with_http_info(campaign_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/eepurl'.sub('{' + 'campaign_id' + '}', campaign_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'EepurlActivity') return data, status_code, headers end # List email activity # Get a list of member's subscriber activity in a specific campaign. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** (default to 10) # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. (default to 0) # @option opts [String] :since Restrict results to email activity events that occur after a specific time. We recommend [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00. # @return [EmailActivity] def get_email_activity_for_campaign(campaign_id = {}, opts = {}) data, _status_code, _headers = get_email_activity_for_campaign_with_http_info(campaign_id, opts) data end # List email activity # Get a list of member's subscriber activity in a specific campaign. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. # @option opts [String] :since Restrict results to email activity events that occur after a specific time. We recommend [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00. # @return [Array<(EmailActivity, Fixnum, Hash)>] EmailActivity data, response status code and response headers def get_email_activity_for_campaign_with_http_info(campaign_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/email-activity'.sub('{' + 'campaign_id' + '}', campaign_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'EmailActivity') return data, status_code, headers end # Get subscriber email activity # Get a specific list member's activity in a campaign including opens, clicks, and bounces. # @param campaign_id The unique id for the campaign. # @param subscriber_hash The MD5 hash of the lowercase version of the list member's email address. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [String] :since Restrict results to email activity events that occur after a specific time. We recommend [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00. # @return [EmailActivity] def get_email_activity_for_subscriber(campaign_id = {}, subscriber_hash = {}, opts = {}) data, _status_code, _headers = get_email_activity_for_subscriber_with_http_info(campaign_id, subscriber_hash, opts) data end # Get subscriber email activity # Get a specific list member's activity in a campaign including opens, clicks, and bounces. # @param campaign_id The unique id for the campaign. # @param subscriber_hash The MD5 hash of the lowercase version of the list member's email address. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [String] :since Restrict results to email activity events that occur after a specific time. We recommend [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00. # @return [Array<(EmailActivity, Fixnum, Hash)>] EmailActivity data, response status code and response headers def get_email_activity_for_subscriber_with_http_info(campaign_id, subscriber_hash, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/email-activity/{subscriber_hash}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s).sub('{' + 'subscriber_hash' + '}', subscriber_hash.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'EmailActivity') return data, status_code, headers end # List top open activities # Get top open locations for a specific campaign. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** (default to 10) # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. (default to 0) # @return [OpenLocations] def get_locations_for_campaign(campaign_id = {}, opts = {}) data, _status_code, _headers = get_locations_for_campaign_with_http_info(campaign_id, opts) data end # List top open activities # Get top open locations for a specific campaign. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. # @return [Array<(OpenLocations, Fixnum, Hash)>] OpenLocations data, response status code and response headers def get_locations_for_campaign_with_http_info(campaign_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/locations'.sub('{' + 'campaign_id' + '}', campaign_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'OpenLocations') return data, status_code, headers end # List campaign open details # Get detailed information about any campaign emails that were opened by a list member. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** (default to 10) # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. (default to 0) # @option opts [String] :since Restrict results to campaign open events that occur after a specific time. We recommend [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00. # @return [OpenDetailReport] def get_campaign_open_details(campaign_id = {}, opts = {}) data, _status_code, _headers = get_campaign_open_details_with_http_info(campaign_id, opts) data end # List campaign open details # Get detailed information about any campaign emails that were opened by a list member. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. # @option opts [String] :since Restrict results to campaign open events that occur after a specific time. We recommend [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time format: 2015-10-21T15:41:36+00:00. # @return [Array<(OpenDetailReport, Fixnum, Hash)>] OpenDetailReport data, response status code and response headers def get_campaign_open_details_with_http_info(campaign_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/open-details'.sub('{' + 'campaign_id' + '}', campaign_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'OpenDetailReport') return data, status_code, headers end # Get opened campaign subscriber # Get information about a specific subscriber who opened a campaign. # @param campaign_id The unique id for the campaign. # @param subscriber_hash The MD5 hash of the lowercase version of the list member's email address. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [OpenActivity] def get_subscriber_info_for_opened_campaign(campaign_id = {}, subscriber_hash = {}, opts = {}) data, _status_code, _headers = get_subscriber_info_for_opened_campaign_with_http_info(campaign_id, subscriber_hash, opts) data end # Get opened campaign subscriber # Get information about a specific subscriber who opened a campaign. # @param campaign_id The unique id for the campaign. # @param subscriber_hash The MD5 hash of the lowercase version of the list member's email address. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [Array<(OpenActivity, Fixnum, Hash)>] OpenActivity data, response status code and response headers def get_subscriber_info_for_opened_campaign_with_http_info(campaign_id, subscriber_hash, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/open-details/{subscriber_hash}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s).sub('{' + 'subscriber_hash' + '}', subscriber_hash.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'OpenActivity') return data, status_code, headers end # List campaign recipients # Get information about campaign recipients. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** (default to 10) # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. (default to 0) # @return [SentTo] def get_campaign_recipients(campaign_id = {}, opts = {}) data, _status_code, _headers = get_campaign_recipients_with_http_info(campaign_id, opts) data end # List campaign recipients # Get information about campaign recipients. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. # @return [Array<(SentTo, Fixnum, Hash)>] SentTo data, response status code and response headers def get_campaign_recipients_with_http_info(campaign_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/sent-to'.sub('{' + 'campaign_id' + '}', campaign_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SentTo') return data, status_code, headers end # Get campaign recipient info # Get information about a specific campaign recipient. # @param campaign_id The unique id for the campaign. # @param subscriber_hash The MD5 hash of the lowercase version of the list member's email address. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [SentTo] def get_campaign_recipient(campaign_id = {}, subscriber_hash = {}, opts = {}) data, _status_code, _headers = get_campaign_recipient_with_http_info(campaign_id, subscriber_hash, opts) data end # Get campaign recipient info # Get information about a specific campaign recipient. # @param campaign_id The unique id for the campaign. # @param subscriber_hash The MD5 hash of the lowercase version of the list member's email address. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [Array<(SentTo, Fixnum, Hash)>] SentTo data, response status code and response headers def get_campaign_recipient_with_http_info(campaign_id, subscriber_hash, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/sent-to/{subscriber_hash}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s).sub('{' + 'subscriber_hash' + '}', subscriber_hash.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SentTo') return data, status_code, headers end # List child campaign reports # Get a list of reports with child campaigns for a specific parent campaign. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [CampaignSubReports] def get_sub_reports_for_campaign(campaign_id = {}, opts = {}) data, _status_code, _headers = get_sub_reports_for_campaign_with_http_info(campaign_id, opts) data end # List child campaign reports # Get a list of reports with child campaigns for a specific parent campaign. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [Array<(CampaignSubReports, Fixnum, Hash)>] CampaignSubReports data, response status code and response headers def get_sub_reports_for_campaign_with_http_info(campaign_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/sub-reports'.sub('{' + 'campaign_id' + '}', campaign_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CampaignSubReports') return data, status_code, headers end # List unsubscribed members # Get information about members who have unsubscribed from a specific campaign. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** (default to 10) # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. (default to 0) # @return [Unsubscribes] def get_unsubscribed_list_for_campaign(campaign_id = {}, opts = {}) data, _status_code, _headers = get_unsubscribed_list_for_campaign_with_http_info(campaign_id, opts) data end # List unsubscribed members # Get information about members who have unsubscribed from a specific campaign. # @param campaign_id The unique id for the campaign. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. # @return [Array<(Unsubscribes, Fixnum, Hash)>] Unsubscribes data, response status code and response headers def get_unsubscribed_list_for_campaign_with_http_info(campaign_id, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/unsubscribed'.sub('{' + 'campaign_id' + '}', campaign_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Unsubscribes') return data, status_code, headers end # Get unsubscribed member # Get information about a specific list member who unsubscribed from a campaign. # @param campaign_id The unique id for the campaign. # @param subscriber_hash The MD5 hash of the lowercase version of the list member's email address. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [Unsubscribes] def get_unsubscribed_list_member(campaign_id = {}, subscriber_hash = {}, opts = {}) data, _status_code, _headers = get_unsubscribed_list_member_with_http_info(campaign_id, subscriber_hash, opts) data end # Get unsubscribed member # Get information about a specific list member who unsubscribed from a campaign. # @param campaign_id The unique id for the campaign. # @param subscriber_hash The MD5 hash of the lowercase version of the list member's email address. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [Array<(Unsubscribes, Fixnum, Hash)>] Unsubscribes data, response status code and response headers def get_unsubscribed_list_member_with_http_info(campaign_id, subscriber_hash, opts = {}) # resource path local_var_path = '/reports/{campaign_id}/unsubscribed/{subscriber_hash}'.sub('{' + 'campaign_id' + '}', campaign_id.to_s).sub('{' + 'subscriber_hash' + '}', subscriber_hash.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Unsubscribes') return data, status_code, headers end end end