Class: Sendgrid::Web::Statistics
- Defined in:
- lib/sendgrid/web/statistics.rb
Instance Method Summary collapse
-
#get(days: nil, start_date: nil, end_date: nil, aggregate: nil, list: nil, category: nil) ⇒ Sendgrid::Web::Response
Retrieve statistics and data about your use of SendGrid.
-
#get_advanced(data_type: nil, start_date: nil, end_date: nil, metric: nil, category: nil, aggregated_by: nil, country: nil) ⇒ Sendgrid::Web::Response
Retrieve more advanced and in-depth statistics.
Methods inherited from Client
base_uri, config, #config, configure
Instance Method Details
#get(days: nil, start_date: nil, end_date: nil, aggregate: nil, list: nil, category: nil) ⇒ Sendgrid::Web::Response
Note:
All parameters are optional.
Retrieve statistics and data about your use of SendGrid.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/sendgrid/web/statistics.rb', line 17 def get( days: nil, start_date: nil, end_date: nil, aggregate: nil, list: nil, category: nil) res = connection.post( '/api/stats.get.json', default_params( days: days, start_date: start_date, end_date: end_date, aggregate: aggregate, list: list, category: category)) craft_response(res) end |
#get_advanced(data_type: nil, start_date: nil, end_date: nil, metric: nil, category: nil, aggregated_by: nil, country: nil) ⇒ Sendgrid::Web::Response
Note:
The data_type
and start_date
parameters are required.
Retrieve more advanced and in-depth statistics.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/sendgrid/web/statistics.rb', line 79 def get_advanced( data_type: nil, start_date: nil, end_date: nil, metric: nil, category: nil, aggregated_by: nil, country: nil) if data_type.nil? raise ArgumentError.new('Missing required `data_type` option') elsif start_date.nil? raise ArgumentError.new('Missing required `start_date` option') end res = connection.post( '/api/stats.getAdvanced.json', default_params( data_type: data_type, start_date: start_date, end_date: end_date, metric: metric, category: category, aggregated_by: aggregated_by, country: country)) craft_response(res) end |