summaryrefslogtreecommitdiffstats
path: root/examples/geo
diff options
context:
space:
mode:
authorElmer Thomas <elmer@thinkingserious.com>2016-06-14 10:22:39 -0700
committerElmer Thomas <elmer@thinkingserious.com>2016-06-14 10:22:39 -0700
commit1e2111f09142552d7dde4e18f116835dec91ed86 (patch)
tree1de111c549454450ce5a45aa129726132db217b5 /examples/geo
parent5ee89f857c09d79e507483bd807727bb6c4d7057 (diff)
parent2e52cfb07decb924a961b5c75ece1b9e79ab973c (diff)
downloadsendgrid-csharp-7.0.1.zip
sendgrid-csharp-7.0.1.tar.gz
sendgrid-csharp-7.0.1.tar.bz2
Merge branch 'v3release'v7.0.1v7.0.0
Diffstat (limited to 'examples/geo')
-rw-r--r--examples/geo/geo.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/examples/geo/geo.cs b/examples/geo/geo.cs
new file mode 100644
index 0000000..25faa04
--- /dev/null
+++ b/examples/geo/geo.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 country and state/province.
+// GET /geo/stats
+
+string queryParams = @"{
+ 'aggregated_by': 'day',
+ 'country': 'US',
+ 'end_date': '2016-04-01',
+ 'limit': 1,
+ 'offset': 1,
+ 'start_date': '2016-01-01'
+}";
+dynamic response = sg.client.geo.stats.get(queryParams: queryParams);
+Console.WriteLine(response.StatusCode);
+Console.WriteLine(response.Body.ReadAsStringAsync().Result);
+Console.WriteLine(response.Headers.ToString());
+Console.ReadLine();
+