Class: Sendpost::StatsAApi
- Inherits:
-
Object
- Object
- Sendpost::StatsAApi
- Defined in:
- lib/sendpost_ruby_sdk/api/stats_a_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_account_aggregate_stats(from, to, opts = {}) ⇒ AggregateStats
Get Account Aggregate Stats Retrieve summarized email statistics across all sub-accounts for a date range.
-
#get_account_aggregate_stats_by_group(group, from, to, opts = {}) ⇒ AggregateStat
Get Account Group Aggregate Stats Retrieve summarized email statistics for a specific group across all sub-accounts.
-
#get_account_aggregate_stats_by_group_with_http_info(group, from, to, opts = {}) ⇒ Array<(AggregateStat, Integer, Hash)>
Get Account Group Aggregate Stats Retrieve summarized email statistics for a specific group across all sub-accounts.
-
#get_account_aggregate_stats_with_http_info(from, to, opts = {}) ⇒ Array<(AggregateStats, Integer, Hash)>
Get Account Aggregate Stats Retrieve summarized email statistics across all sub-accounts for a date range.
-
#get_account_stats_by_group(group, from, to, opts = {}) ⇒ Array<Stat>
List Account Group Stats Retrieve daily email statistics for a specific group across all sub-accounts.
-
#get_account_stats_by_group_with_http_info(group, from, to, opts = {}) ⇒ Array<(Array<Stat>, Integer, Hash)>
List Account Group Stats Retrieve daily email statistics for a specific group across all sub-accounts.
-
#get_all_account_stats(from, to, opts = {}) ⇒ Array<AccountStats>
List Account Stats Retrieve daily email statistics aggregated across all sub-accounts.
-
#get_all_account_stats_with_http_info(from, to, opts = {}) ⇒ Array<(Array<AccountStats>, Integer, Hash)>
List Account Stats Retrieve daily email statistics aggregated across all sub-accounts.
-
#initialize(api_client = ApiClient.default) ⇒ StatsAApi
constructor
A new instance of StatsAApi.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/sendpost_ruby_sdk/api/stats_a_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_account_aggregate_stats(from, to, opts = {}) ⇒ AggregateStats
Get Account Aggregate Stats
Retrieve summarized email statistics across all sub-accounts for a date range. Returns a single aggregated record—perfect for high-level reporting and dashboards. Use Cases: - Annual email program review - Quarterly business reports - Month-over-month comparison - Board-level metrics - ROI calculations for email program Example: Get full year stats for 2024: GET /account/stat/aggregate?from=2024-01-01&to=2024-12-31 Note: Maximum date range is 366 days (1 year).
28 29 30 31 |
# File 'lib/sendpost_ruby_sdk/api/stats_a_api.rb', line 28 def get_account_aggregate_stats(from, to, opts = {}) data, _status_code, _headers = get_account_aggregate_stats_with_http_info(from, to, opts) data end |
#get_account_aggregate_stats_by_group(group, from, to, opts = {}) ⇒ AggregateStat
Get Account Group Aggregate Stats
Retrieve summarized email statistics for a specific group across all sub-accounts. Returns a single aggregated record for the group—ideal for campaign reporting. Use Cases: - Annual performance report for a specific product integration - Compare total metrics for different campaigns - Summarize email performance for a specific customer segment - Calculate ROI for a marketing campaign by group Example: Get yearly stats for Shopify integration: GET /account/stat/aggregate/group?group=shopify&from=2024-01-01&to=2024-12-31 Note: Maximum date range is 366 days (1 year).
100 101 102 103 |
# File 'lib/sendpost_ruby_sdk/api/stats_a_api.rb', line 100 def get_account_aggregate_stats_by_group(group, from, to, opts = {}) data, _status_code, _headers = get_account_aggregate_stats_by_group_with_http_info(group, from, to, opts) data end |
#get_account_aggregate_stats_by_group_with_http_info(group, from, to, opts = {}) ⇒ Array<(AggregateStat, Integer, Hash)>
Get Account Group Aggregate Stats Retrieve summarized email statistics for a specific group across all sub-accounts. Returns a single aggregated record for the group—ideal for campaign reporting. Use Cases: - Annual performance report for a specific product integration - Compare total metrics for different campaigns - Summarize email performance for a specific customer segment - Calculate ROI for a marketing campaign by group Example: Get yearly stats for Shopify integration: ``` GET /account/stat/aggregate/group?group=shopify&from=2024-01-01&to=2024-12-31 ``` Note: Maximum date range is 366 days (1 year).
112 113 114 115 116 117 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 |
# File 'lib/sendpost_ruby_sdk/api/stats_a_api.rb', line 112 def get_account_aggregate_stats_by_group_with_http_info(group, from, to, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StatsAApi.get_account_aggregate_stats_by_group ...' end # verify the required parameter 'group' is set if @api_client.config.client_side_validation && group.nil? fail ArgumentError, "Missing the required parameter 'group' when calling StatsAApi.get_account_aggregate_stats_by_group" end # verify the required parameter 'from' is set if @api_client.config.client_side_validation && from.nil? fail ArgumentError, "Missing the required parameter 'from' when calling StatsAApi.get_account_aggregate_stats_by_group" end # verify the required parameter 'to' is set if @api_client.config.client_side_validation && to.nil? fail ArgumentError, "Missing the required parameter 'to' when calling StatsAApi.get_account_aggregate_stats_by_group" end # resource path local_var_path = '/account/stat/aggregate/group' # query parameters query_params = opts[:query_params] || {} query_params[:'group'] = group query_params[:'from'] = from query_params[:'to'] = to # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'AggregateStat' # auth_names auth_names = opts[:debug_auth_names] || ['accountAuth'] = opts.merge( :operation => :"StatsAApi.get_account_aggregate_stats_by_group", :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: StatsAApi#get_account_aggregate_stats_by_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_account_aggregate_stats_with_http_info(from, to, opts = {}) ⇒ Array<(AggregateStats, Integer, Hash)>
Get Account Aggregate Stats Retrieve summarized email statistics across all sub-accounts for a date range. Returns a single aggregated record—perfect for high-level reporting and dashboards. Use Cases: - Annual email program review - Quarterly business reports - Month-over-month comparison - Board-level metrics - ROI calculations for email program Example: Get full year stats for 2024: ``` GET /account/stat/aggregate?from=2024-01-01&to=2024-12-31 ``` Note: Maximum date range is 366 days (1 year).
39 40 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 |
# File 'lib/sendpost_ruby_sdk/api/stats_a_api.rb', line 39 def get_account_aggregate_stats_with_http_info(from, to, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StatsAApi.get_account_aggregate_stats ...' end # verify the required parameter 'from' is set if @api_client.config.client_side_validation && from.nil? fail ArgumentError, "Missing the required parameter 'from' when calling StatsAApi.get_account_aggregate_stats" end # verify the required parameter 'to' is set if @api_client.config.client_side_validation && to.nil? fail ArgumentError, "Missing the required parameter 'to' when calling StatsAApi.get_account_aggregate_stats" end # resource path local_var_path = '/account/stat/aggregate' # query parameters query_params = opts[:query_params] || {} query_params[:'from'] = from query_params[:'to'] = to # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'AggregateStats' # auth_names auth_names = opts[:debug_auth_names] || ['accountAuth'] = opts.merge( :operation => :"StatsAApi.get_account_aggregate_stats", :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: StatsAApi#get_account_aggregate_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_account_stats_by_group(group, from, to, opts = {}) ⇒ Array<Stat>
List Account Group Stats
Retrieve daily email statistics for a specific group across all sub-accounts. Returns one record per day, filtered by the group/tag you specify. What are Groups? Groups (tags) are labels attached to emails when sending. They enable segmented analytics across your entire account. Common Group Strategies: | Strategy | Example Groups | |----------|----------------| | By Product | shopify, wordpress, api-direct | | By Type | transactional, marketing, alerts | | By Team | sales-team, support, engineering | | By Campaign | black-friday-2024, summer-sale | Use Cases: - Compare performance across products/integrations - Track specific campaign performance account-wide - Analyze transactional vs marketing metrics - Benchmark different teams' email performance Note: Maximum date range is 31 days.
178 179 180 181 |
# File 'lib/sendpost_ruby_sdk/api/stats_a_api.rb', line 178 def get_account_stats_by_group(group, from, to, opts = {}) data, _status_code, _headers = get_account_stats_by_group_with_http_info(group, from, to, opts) data end |
#get_account_stats_by_group_with_http_info(group, from, to, opts = {}) ⇒ Array<(Array<Stat>, Integer, Hash)>
List Account Group Stats Retrieve daily email statistics for a specific group across all sub-accounts. Returns one record per day, filtered by the group/tag you specify. What are Groups? Groups (tags) are labels attached to emails when sending. They enable segmented analytics across your entire account. Common Group Strategies: | Strategy | Example Groups | |----------|----------------| | By Product | `shopify`, `wordpress`, `api-direct` | | By Type | `transactional`, `marketing`, `alerts` | | By Team | `sales-team`, `support`, `engineering` | | By Campaign | `black-friday-2024`, `summer-sale` | Use Cases: - Compare performance across products/integrations - Track specific campaign performance account-wide - Analyze transactional vs marketing metrics - Benchmark different teams' email performance Note: Maximum date range is 31 days.
190 191 192 193 194 195 196 197 198 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 |
# File 'lib/sendpost_ruby_sdk/api/stats_a_api.rb', line 190 def get_account_stats_by_group_with_http_info(group, from, to, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StatsAApi.get_account_stats_by_group ...' end # verify the required parameter 'group' is set if @api_client.config.client_side_validation && group.nil? fail ArgumentError, "Missing the required parameter 'group' when calling StatsAApi.get_account_stats_by_group" end # verify the required parameter 'from' is set if @api_client.config.client_side_validation && from.nil? fail ArgumentError, "Missing the required parameter 'from' when calling StatsAApi.get_account_stats_by_group" end # verify the required parameter 'to' is set if @api_client.config.client_side_validation && to.nil? fail ArgumentError, "Missing the required parameter 'to' when calling StatsAApi.get_account_stats_by_group" end # resource path local_var_path = '/account/stat/group' # query parameters query_params = opts[:query_params] || {} query_params[:'group'] = group query_params[:'from'] = from query_params[:'to'] = to # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<Stat>' # auth_names auth_names = opts[:debug_auth_names] || ['accountAuth'] = opts.merge( :operation => :"StatsAApi.get_account_stats_by_group", :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: StatsAApi#get_account_stats_by_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_all_account_stats(from, to, opts = {}) ⇒ Array<AccountStats>
List Account Stats
Retrieve daily email statistics aggregated across all sub-accounts. Returns one record per day within the date range—ideal for organization-wide reporting. Metrics Per Day: | Metric | Description | |--------|-------------| | processed | Total emails submitted across all sub-accounts | | delivered | Successfully delivered to recipients | | dropped | Blocked before sending | | hardBounced | Permanent delivery failures | | softBounced | Temporary delivery failures | | opens | Total email opens | | clicks | Total link clicks | | unsubscribed | Recipients who unsubscribed | | spams | Spam complaints received | Use Cases: - Organization-wide email performance dashboard - Billing and usage tracking across all sub-accounts - Executive reporting for email program health - Trend analysis across your entire email operation Note: Maximum date range is 31 days.
255 256 257 258 |
# File 'lib/sendpost_ruby_sdk/api/stats_a_api.rb', line 255 def get_all_account_stats(from, to, opts = {}) data, _status_code, _headers = get_all_account_stats_with_http_info(from, to, opts) data end |
#get_all_account_stats_with_http_info(from, to, opts = {}) ⇒ Array<(Array<AccountStats>, Integer, Hash)>
List Account Stats Retrieve daily email statistics aggregated across all sub-accounts. Returns one record per day within the date range—ideal for organization-wide reporting. Metrics Per Day: | Metric | Description | |--------|-------------| | `processed` | Total emails submitted across all sub-accounts | | `delivered` | Successfully delivered to recipients | | `dropped` | Blocked before sending | | `hardBounced` | Permanent delivery failures | | `softBounced` | Temporary delivery failures | | `opens` | Total email opens | | `clicks` | Total link clicks | | `unsubscribed` | Recipients who unsubscribed | | `spams` | Spam complaints received | Use Cases: - Organization-wide email performance dashboard - Billing and usage tracking across all sub-accounts - Executive reporting for email program health - Trend analysis across your entire email operation Note: Maximum date range is 31 days.
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
# File 'lib/sendpost_ruby_sdk/api/stats_a_api.rb', line 266 def get_all_account_stats_with_http_info(from, to, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StatsAApi.get_all_account_stats ...' end # verify the required parameter 'from' is set if @api_client.config.client_side_validation && from.nil? fail ArgumentError, "Missing the required parameter 'from' when calling StatsAApi.get_all_account_stats" end # verify the required parameter 'to' is set if @api_client.config.client_side_validation && to.nil? fail ArgumentError, "Missing the required parameter 'to' when calling StatsAApi.get_all_account_stats" end # resource path local_var_path = '/account/stat' # query parameters query_params = opts[:query_params] || {} query_params[:'from'] = from query_params[:'to'] = to # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<AccountStats>' # auth_names auth_names = opts[:debug_auth_names] || ['accountAuth'] = opts.merge( :operation => :"StatsAApi.get_all_account_stats", :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: StatsAApi#get_all_account_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |