diff options
Diffstat (limited to 'examples/mailboxproviders/mailboxproviders.cs')
-rw-r--r-- | examples/mailboxproviders/mailboxproviders.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/examples/mailboxproviders/mailboxproviders.cs b/examples/mailboxproviders/mailboxproviders.cs new file mode 100644 index 0000000..b307fc4 --- /dev/null +++ b/examples/mailboxproviders/mailboxproviders.cs @@ -0,0 +1,25 @@ +using System; +using SendGrid.Helpers.Mail; +using System.Collections.Generic; + +string _apiKey = Environment.GetEnvironmentVariable("SENDGRID_APIKEY", EnvironmentVariableTarget.User); +dynamic sg = new SendGrid.SendGridAPIClient(_apiKey); + +//////////////////////////////////////////////////////// +// Retrieve email statistics by mailbox provider. +// GET /mailbox_providers/stats + +string queryParams = @"{ + 'aggregated_by': 'day', + 'end_date': '2016-04-01', + 'limit': 1, + 'mailbox_providers': 'test_string', + 'offset': 1, + 'start_date': '2016-01-01' +}"; +dynamic response = sg.client.mailbox_providers.stats.get(queryParams: queryParams); +Console.WriteLine(response.StatusCode); +Console.WriteLine(response.Body.ReadAsStringAsync().Result); +Console.WriteLine(response.Headers.ToString()); +Console.ReadLine(); + |